This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes need help with hibernate query 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 "need help with hibernate query" Watch "need help with hibernate query" New topic
Author

need help with hibernate query

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 356
I have following entities.



i.e. there is many(Guitar) to one(GuitarSpec) relation. I am fetching a row from GuitarSpec(these rows are unique). Now i want to fetch rows from Guitar(Column specification_id references the specId from GuitarSpec).

I am trying the following but it does not work.



I am able to fetch GuitarSpec , but not able to fetch Guitar. How can i fetch Guitar.

Thanks.

SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 356
I was able to solve the problem using following query:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help with hibernate query
 
Similar Threads
Getting HibernateException: Errors in named queries
ORA-00001: unique constraint exception
Getting same record in query.
Lazy loading not working as expected
Disagreement with Encapsulation example of Head First OOAD