floyd,

Thanks for your response.

>         The easiest way is to traverse the relationships of
> your entity beans.
> Since each entity bean typically maps to a database table,
> find the first
> entitybean you are interested, get the other entity bean
> associated with it,
> get both their details objects and return them to the client.

I initially thought of doing the above but if the final result set is just
2-3 records for which we may have to retrieve thousands of records (i.e
create entity beans) in the process, it didn't look efficient to me.

>         Your alternative is to hardcode the sql join into a
> session bean method,
> but then you lose the advantage of having your entity beans
> be your single
> access point to the database (sql schema information has been
> copied all
> over your app).

During the weekend, I implemented a "queries" stateless session bean to do
the join queries. This I found to be the most optimal solution. In my
project here, the sql schema won't change much but the solution has to work
for multiple app servers. I think having it as a session bean is more
appropriate than entity bean as "persistance" is not involved.

I am all ears for better ways to design  ...

Thanks,
Subu

===========================================================================
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