-->
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: multiple criteria's
PostPosted: Mon Jul 14, 2008 7:47 pm 
Newbie

Joined: Mon Jul 14, 2008 7:38 pm
Posts: 2
HI,

I am new to hibernate. I have a scenario where i would like to use multiple criteria's. I have a map where i will be popping up the elements and try to AND them / OR them. So, is their a better way than using criteria because when we use criteria we need to give it a session. But, i should not give any session to it and get the criteria in a separate class to give it a session. I thought detached criteria's might be helpfull but couldn't figure out.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 9:52 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Well, one approach might just be to populate a POJO with pertinent data provided as input. Then, just pass the POJO with its properties loaded along through the app. When it gets to your Hibernate layer, use that POJO to create a Hibernate Example Criteria Query.

Here's a great tutorial on using the HibernateCriteria API with Example objects:

http://www.hiberbook.com/HiberBookWeb/learn.jsp?tutorial=09howtousethecriteriaapi

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.