Hi Marius,
I'm not sure how your entity actually look like - the code in the link has all annotations commented out, but the person field is either a relationship (and must be marked as such) or a BLOB (i.e. expected to be stored as a serializable stream). In any case, you can't compare it to a String or an integer. When you use SQL, you most probably compare the value in the FK column directly, which of course works.
Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=231855