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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
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: 17257
    
    6

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: 33

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.



 
 
subject: How To retrive data using Hibernate