I want to write a customised finder method for my CMP EJB. The EJB has a one to many relationship with another bean.
How can i write EJB-QL that will return results matching criteria in both beans..this is how i would do it in oracle....
SELECT * FROM BGS.WELL_DATA A, BGS.SURF_DEPTHS B WHERE A.WID=B.WID AND A.WID=4 AND B.SOURCE='SH'
Damanjit Kaur
Ranch Hand
Joined: Oct 18, 2004
Posts: 346
posted
0
SELECT * FROM BGS.WELL_DATA A, BGS.SURF_DEPTHS B WHERE A.WID=B.WID AND A.WID=4 AND B.SOURCE='SH'
It would be like this :
assuming its one to many relationship between tables WELL_DATA and SURF_DEPTHS and unidirectional from WELL_DATA to SURF_DEPTHS. In WELL_DATA CMP, we have a cmr field - surfdepths.
SELECT OBJECT(o) FROM schemaNameInWell_DataCMP o IN (o.surfdepths) y WHERE o.wid=?1 AND y.source=?2
where wid and source are cmp fields in both CMPs and finder method signature can be like :