IntelliJ Java IDE
The moose likes Object Relational Mapping and the fly likes Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate" Watch "Hibernate" New topic
Author

Hibernate

kiran medisetty
Greenhorn

Joined: Nov 29, 2004
Posts: 4
Hi,
I have a table called Temp_Fields. The table has 8 cols.
Two cols namely A,B makes a composite key which uniquely identifies a record in the table. Both A, B are numeric types

Application requirement is -

I want to get all the records from the Table Temp_Fields, where the COL A = 0.

I have done the following -

A. In the hibernate mapping file, created a composite key element with the above cols with mapping properites.

B. When i am using a hibernate query langage as follows
i starte it without select clause(assuming, it selects all cols from the table above
from temp_field t(which is a mapping class name for the table above)
where t.property for Col A = 0
order by t.propert for Col B..

When i do this, i am getting a hibernate grammer exception...

So,,,, please suggest how to run queries in hibernate language using a partial key in the where clause....

thanks
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
It would be a good start to show us some code, your mappings or the relevant parts of it as well as the exception stacktrace! (and then a better title for your question would not hurt since nearly all questions in this forum are about hibernate)

pascal
 
jQuery in Action, 2nd edition
 
subject: Hibernate
 
Threads others viewed
Eager Fetching a Polymorphic SET
how to interpret this relation(optional one to one) in Hibernate
Two PKs
How to query a value typed object
Composite foreign key mapping in Hibernate 3 using JPA
developer file tools