Add testQueryBeforeAfterUpdateForSubobjectToLooseReference

Test is in reponse to #378#discussion_r14574081