wood burning stoves 2.0*
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
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:

 
 
subject: need help with hibernate query