I have some SQL that will successfully retrieve the data I want:
select distinct c.* from CHECKPOINTS c, ROUTEPOINTS rp WHERE rp.CHECKPOINT = c.OID and rp.POINTNO != 1 order by c.OID
The two relevant classes are not mapped with XML or annotations, so I need to find a way of replicating the above query using Hibernate. No preference between the various ways of fetching data, but I need to get all the checkpoint objects (and only checkpoint objects) where the id column (OID) for the checkpoint is in the RoutePoint.checkpointOID property and the RoutePoint.pointNo property is not 1.
Hope that makes sense. Please make your answers as numpty friendly as possible - I'm new to this Hibernate game. The docs/examples I've read all seem to assume that the objects have some sort of relationship defined between the classes already (be it XML or annotation style).
|