1 Reply Latest reply on Apr 19, 2002 10:14 PM by dsundstrom

    EJB-QL and relationship question

    mister_fab

      Let say I have a Message entity and an Author entity with a one to many relation between the Author and the Message. If I want to select all the messages from a specific author then I could use the folowing query :


      SELECT OBJECT(m) FROM Author a, IN( u.messages ) m WHERE a = ?1

      It works fine for me but I think the following query is more simple and I do not understand why it doesnt work :

      SELECT object(m) FROM Message m WHERE m.author = ?1

      Could somebody bring some light on this ?

      f.