Hibernate HQL-where question
I am using hibernate at the moment and defining some functions to retrieve specific values from the database.
Now I wanted to change something like this:
User user =new User();
user.setUserId( 1);
user = session.createQuery("from User u where u.userId = '"+user.getUserId()+"'").uniqueResult();
to:
User user =new User();
user.setUserId( 1);
user = session.createQuery("from User u where u = '"+user+"'").uniqueResult();
But this does not work (the first one works fine), i hoped that it would look through the mapping file to check what is the main identifier for the class, and retrieve the values based on that.
Is this possible in any other way, or is this not (yet) implemented?

