You have the following options depending on exactly what you join statement
is doing.

1. Get a good cmp engine. The obvious. One which supports calling stored
procedures from the finder would be useful in the meantime until better
mapping tools are provided. TopLink could be an option; I am not an expert
user but I have heard good things about this add-on product.

2. Embed a sub-select query in your finder's where clause. This can be used
where you do know have access to the complete sql statement i.e. the FROM
section.

3. Create a hybrid entity bean which uses container managed persistence for
all others finders, ejb* apart from the join finder. The hybrid can then do
the one of the following:

a. Issue the complete SQL statement to the database. The problems with this
are performance and maintainability. The performance of the affectively bean
managed find method is that number of SQL statements can be quite high. If
you find method returns 1000 primary keys this will result in 1 + 1000 SQL
statements for the loading part. Container managed persistence can be
configured to reduce this to 1. The find method returns all the state
instead of just the primary key.

b. Call another find method on the same home (same bean impl) with some of
the parameters and then with these beans perform some query on the
association i.e. issues selects against the second home (if the table maps
to an entity bean) using the primary key of the first bean. This work in the
case ofa 1-M relationship. The benefits here is that we can potential reduce
the number of SQL calls since the first home will load the state from a
super set of our result set.

c. Start from the other entity bean or table and work back.

There is probably more ways of combining these things. The performance of
your system will be indicative of the number of SQL calls you make. So
analyse the data / key distribution and see when you can reduce it by using
the some of the above.

kind regards,

William Louth

> -----Original Message-----
> From: Alex Paransky [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 04, 2000 4:23 AM
> To:   [EMAIL PROTECTED]
> Subject:      Implementing using CMP quickly runs in to limitation...
>
> I started to implement my system using CMP Entity Beans.  However, the
> minute I needed to execute a JOIN in order to implement one of the finder
> methods, I realized that I have a problem.  It seems, that CMP is only
> good
> for TRIVIAL object relationships.  The minute a query needs to JOIN from
> more than one table in order to execute the find, CMP shows it's
> limitations.  This means, that for all but the simplest of objects, I need
> to use BMP (which appears to be much slower).  Is this what most of you
> have
> found?  Am I missing something when it comes to CMP?
>
> Thanks.
> -AP_
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to