This is the right idea; you want to do a join in the finder.  Relational
databases were designed to do exactly this sort of thing.  Putting extra
information in the EJBs would just lead to consistency problems, IMHO.  

The EJB 2.0 specification defines EJB QL, which is a
database-independent query language reminiscent of SQL and the preferred
solution to your problem.  Unfortunately Orion does not yet support EJB
QL, so you need to manually specify the join in SQL in the
orion-ejb-jar.xml finder definition.

You will need to use a partial="false" finder to do a join, which means
you need to be very careful about how you specify the select.  Select
table.* should work if you allowed Orion to create the table in the
first place.  Otherwise you'll need to make sure that the columns are
specified in the same order as the fields in ejb-jar.xml.

You will probably want to put this new finder definition in an
orion-ejb-jar.xml fragment included in your ejb jar file so that
deploying your j2ee app on a new server will automatically include the
changes.  There is much discussion in the archives about how to do this.

Good luck!

Jeff

>-----Original Message-----
>From: Adam Cassar [mailto:[EMAIL PROTECTED]]
>Sent: Monday, April 16, 2001 6:41 PM
>To: Orion-Interest
>Subject: Re: findBy referencing another entity reference
>
>
>
>I found this reply to an earlier posting quite usefull.
>
>http://www.mail-archive.com/orion-interest@orionserver.com/msg1
>2085.html
>

Reply via email to