-->
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.  [ 2 posts ] 
Author Message
 Post subject: Converting HQL to Criteria
PostPosted: Wed Dec 19, 2007 8:16 am 
Newbie

Joined: Wed Dec 19, 2007 7:10 am
Posts: 10
Hello,

Is there any way to convert some HQL into a Criteria object? The Criteria objects seem to be more useful (in terms of tuning fetch strategies, etc.) yet I can't see an obvious mechanism I can write out my query in HQL but can't see how it's performed using a Criteria:

from Login l1, Login l2
where l1.time>=1197800000000 and l2.time>=1197800000000
and l1.time<1197904133904 and l2.time<1197904133904
and l1.id!=l2.id
and l1.user=l2.user
and abs(l1.time-l2.time)<1000)

Could someone show me how to create a Criteria that performs the above join?

Thanks,


John


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 19, 2007 9:13 am 
Regular
Regular

Joined: Sat Nov 25, 2006 11:37 am
Posts: 72
AFAIK you cannot formulate explicit joins using the Hibernate Criteria object.


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

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.