-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Joining tables that aren't mapped
PostPosted: Thu Feb 16, 2012 2:30 pm 
Newbie

Joined: Wed Nov 30, 2011 7:06 am
Posts: 6
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).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.