aspose file tools
The moose likes Object Relational Mapping and the fly likes How To retrive data using Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "How To retrive data using Hibernate" Watch "How To retrive data using Hibernate" New topic
Author

How To retrive data using Hibernate

Pradyumna Khadanga
Greenhorn

Joined: Aug 18, 2009
Posts: 5
Hi I want to write the following Query By using findByCriteria(Detached Criteria) to get the data
using Hibernate

"select a.organization_id From JCTS_PROJECT_INV a,JCTS_PROJECT c
where a.PROJECT_ID=c.PROJECT_ID and c.CUSTOMER_ID=4003640"

Please Help me .
Thanks & regards
Pradyumna



Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17234
    
    1

Moving this to the ORM forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ganesh Shirsat
Ranch Hand

Joined: Jan 10, 2010
Posts: 30

hi,

List cats = sess.createCriteria(JCTS_PROJECT_INV .class)
.add( Restrictions.eq("CUSTOMER_ID", "4003640") )
.setFetchMode("JCTS_PROJECT ", FetchMode.EAGER)
.list();

i think this will help you. it will prepare the outer join query for JCTS_PROJECT_INV AND JCTS_PROJECT class.



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To retrive data using Hibernate
 
Similar Threads
Load Data into database using Hibernate
getting data using Hibernate
Inserting a blob using hibernate
Help in Data exports
EHCache not working