hibernate Query by primary key

Posted by adisembiring on Stack Overflow See other posts from Stack Overflow or by adisembiring
Published on 2010-05-17T08:57:57Z Indexed on 2010/05/17 10:01 UTC
Read the original article Hit count: 275

Filed under:
|
|

Hi ...

I wanna create query by primary key. Supposed I have class primary key, PersonKey, the properties is name and id.

I have Person class, the property is PersonKey, address, DOB.

Now, I wanna search person by primary key.

First, I create instance of PersonKey, and set the name become: joe, and id become:007

can I get the person by ID, by pass the key variable ???

person.findByKey(someKey); , but the logic do not criteria

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about java