postgresql - hibernate enverse : how to get changed value in relation field -
i using hibernate enverse 5.2.10.final postgres data base.
auditreader auditreader = auditreaderfactory.get(entitymanager); string newvalue = (string) auditreader.createquery() .forentitiesatrevision(vehicle.class, 2203869) .traverserelation("vehicletype", jointype.inner).addprojection(auditentity.property("id")).up() .add(auditentity.property("vehicletype").haschanged()) .add(auditentity.id().eq(2203422l)) .add(auditentity.revisionnumber().eq(2203869)).getsingleresult();
vehicle table has many-to-one relationship vehicletype. how changes of vehicle type property of vehicle entity using enverse query. here no result found error. cannot get value audientity.property("vehicletype")..haschanged() their's error property not found.
auditreader.createquery() .forentitiesatrevision( vehicle.class, revisionnumber ) .traverserelation( propertyname, jointype.left ) .addprojection( auditentity.property("id") ).up() .add( auditentity.property( propertyname ).haschanged() ) .add( auditentity.id().eq( vehicleid ) ) .getsingleresult()
Comments
Post a Comment