tags:

views:

30

answers:

2

@Id
int master_id;

@Id int id;

........this is not working:
User user= (User) session.load(User.class, new Integer(master_id), new Integer(id));

A: 

load(Class theClass, Serializable id)

replaced the last two arguments with a serilizable object and still cannot retrive the object.

+1  A: 

well, problem solved using @Embeddable!

@Embeddable public class UsertId implements Serializable{
int master_id;
int id;
//.....setter &getter }

//and in the bean, the type for Id should be UsertId
@Id
UsertId id;

Glad we could help.
skaffman