-->
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.  [ 3 posts ] 
Author Message
 Post subject: merging criteria
PostPosted: Thu Aug 11, 2005 12:30 pm 
Newbie

Joined: Thu Aug 11, 2005 12:21 pm
Posts: 2
Maybe it´s odd, but... i have two Criteria instances and i want to merge them. Is it possible?

Example:
Code:
Criteria a = session.createCriteria(A.class).add(...);
Criteria b = session.createCriteria(B.class).add(...);

//suppose an attribute on B to join with A
b.createAlias("somethingAboutA", "alias").add( try to import criteria from a );


Maybe is not a good example. If i could extract the Criterion's from Criteria it would be enough.

Thanx for attention.

_________________
[<o>] Emerson


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 1:16 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Take a look at detached criteria with subqueries

http://www.hibernate.org/hib_docs/v3/re ... hedqueries

_________________
Seb
(Please don't forget to give credits if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 11, 2005 7:46 pm 
Newbie

Joined: Thu Aug 11, 2005 12:21 pm
Posts: 2
Thank you!
I think it will fit.

_________________
[<o>] Emerson


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.