Bryan Field-Elliot wrote:
> I thought I'd share with the group that it appears possible to use JOIN's in
> the finder methods of CMP entity beans. This is a great time saver! The spec
> indicates that in the deployment descriptor, the:
>
> <jdbc-where-clause>
>
> should just contain a WHERE clause, such as:
>
> <jdbc-where-clause>where Customer = ?</jdbc-where-clause>
>
> However, I have found that appending a comma following by a series of
> tables, then a WHERE clause with join conditions, works fine! This is great!
>
> <jdbc-where-clause>,Orders where Customers.ID = Orders.CustomerID and
> Orders.Type = ?</jdbc-where-clause>
>
I was getting similar results under jonas 1.6 using IN, as
WHERE Customers.ID IN (SELECT CustomerID FROM Orders WHERE Orders.Type = ?)
but I'm not sure every DB supports IN.
There should be a better way to model relations under EJB 1.1 (I haven�t studied
it in detail). If we program this way, we are mixing DB relations with Bean
relations, and that is not very clean, since in CMP we are looking for
independence from the persistance engine (DB, LDAP, ...)
>
> So, in case this is un-intentional, I'd like to ask the JOnAS team to please
> NOT break this in any future releases, and consider documenting it. It's
> very useful!
>
> Bryan
>
>
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".