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

    EJB-QL and relationship question

    fabrice armisen Newbie

      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.