[jboss-user] [EJB/JBoss] - ejb-ql with a multi-table query?

homerlex do-not-reply at jboss.com
Thu Oct 5 09:28:52 EDT 2006


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?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3976309#3976309

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3976309



More information about the jboss-user mailing list