persistence@glassfish.java.net

SQLException running EJBQL query selecting association field

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Mon, 31 Oct 2005 15:11:22 +0100

Hi Tom,

I run into a problem with an EJBQL query selecting an association field:

EJBQL: SELECT o.customer FROM Order o
SQL: SELECT CMP3_ORDER.ORDER_ID, CMP3_ORDER.SHIP_ADDR,
               CMP3_ORDER.CREATION_DATE, CMP3_ORDER.TOTAL_PRICE,
               CMP3_ORDER.ORDER_VERSION, CMP3_ORDER.QUANTITY,
               CMP3_ORDER.ITEM_ID, CMP3_ORDER.CUST_ID
        FROM CMP3_CUSTOMER t0, CMP3_ORDER t1
        WHERE (t0.CUST_ID (+) = t1.CUST_ID)
Running the above query on a Oracle database results in a SQLException:
ORA-00904: "CMP3_ORDER"."CUST_ID": invalid identifier.

Any idea?

I filed an glassfish issue and assigned to you:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=67

Regards Michael