wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Hibernate Criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Criteria" Watch "Hibernate Criteria" New topic
Author

Hibernate Criteria

Pradeep Chandrasekharan Nair
Ranch Hand

Joined: Apr 01, 2004
Posts: 48
I have a Candidate bean and inside that I have Job object. If I criteria on Candidate it will give a list of candidates. Is there any way to get a list of jobs instead of candidates if I create criteria on Candidate?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Well, not really. Basically the class thatyou pass to the creation of the main Criteria object is the list of object types that you are going to get back. So if you want a list of the other objects make your Criteria object based on that. You can always do joins in a Criteria. Check out http://www.javalobby.org/articles/hibernatequery102/ at the bottom, the last two pieces of code you see is creating a join.

Good Luck

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Criteria
 
Similar Threads
Duplicate results in Hibernate many to many mapping.
fetching records by using hql and criteria is taking more time
Bangalore-India Java/J2EE 1-4 Yrs
how do you interview?
greatest rock band ever?