for the OneToMany, I can use the workaround to find some correct {code}
AuditReader reader = AuditReaderFactory.get(session); List<Number> REVS = reader.getRevisions(Parent.class,"Parent"); Number n = REVS.get(REVS.size()-1); deal = (E) reader.find(o.getClass(), entityName, id, n, true); Parent deletedObject = reader.find(Parent.class,Parent.class.getName(), "Parent", n, true); List<Child> children = (List<Child>)deletedObject.getChild(); assert children.size()>0:"Expect the result should not zero";
tx.commit(); {code}
for the OneToOne ,the generated seem not correct I expect it generate code like {code} select e__ from tpdrg.data.deals.TargetRedemption.TargetRedemptionStrike_AUD e__ where e__.originalId.REV.id = ( select max(e2__.originalId.REV.id) from tpdrg.data.deals.TargetRedemption.TargetRedemptionStrike_AUD e2__ where e2__.originalId.REV.id <= :revision and e__.originalId.OID = e2__.originalId.OID ) and e__. deal_OID = :_p1 {code} but {code} select e__ from tpdrg.data.deals.TargetRedemption.TargetRedemptionStrike_AUD e__ where e__.originalId.REV.id = ( select max(e2__.originalId.REV.id) from tpdrg.data.deals.TargetRedemption.TargetRedemptionStrike_AUD e2__ where e2__.originalId.REV.id <= :revision and e__.originalId.OID = e2__.originalId.OID ) and e__. REVTYPE <> :_p0 and e__.deal_OID = :_p1 {code}
|