0 Replies Latest reply on Oct 5, 2006 9:28 AM by homer homer

    ejb-ql with a multi-table query?

    homer homer Newbie

      EJB 2.0 CMP

      I have a bean that I need to define a query for that needs to access not only the bean's associated table but also another table.

      The query needs to look something like this:

      <ejb-ql>SELECT OBJECT(a) FROM table_a a, table_b b WHERE a.item_id = b.item_id AND a.category_id = ?1 AND b.user_id = ?2</ejb-ql>

      My ejb knows about table_a because its defined as:
      <abstract-schema-name>table_a</abstract-schema-name>

      But is has no clue about table b. Is there something that needs to be declared in the ejb-jar.xml?