• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How To retrive data using Hibernate

 
Pradyumna Khadanga
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the ORM forum.

Mark
 
Ganesh Shirsat
Ranch Hand
Posts: 33
Google Web Toolkit Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic