I did, posting a question with the subject "Implementing using CMP quickly
runs in to limitation...".  You responded with

"there are servers (like orion or ejipt and
probably many more) that let you define whatever sql you like for your
finders while you still benefit from the optimizations of cmp like result
set caching."

I AM using Orion, and have not been able to figure out how to put my own SQL
statement in to the finder.  I have read the documentation (on the orion
site) regarding custom finders, and that only talks about specifying
$value=$1 which gets translated in to the WHERE clause.

Could you possibly clue me in on how to specify a full SQL with Orion?  I DO
need to join at least two tables to properly implement this finder.

On the same topic of finders, I have a finder defined like so:

Enumeration findByOrderType(OrderType type) throws EJBException,
FinderException

I am not sure if I can do this, but the actual SELECT statement needs to
work with type.getId().  But I do not want to expose this to the client by
changing the API to:

Enumeration findOrderType(int orderType) throws EJBException,
FinderExeption.

In other words, when the SQL statement is generated I want to execute "int
OrderType.getId()" and use the return of this function in the SQL statement.
Is there a way to do this?

Thanks
-AP_



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Robert Krüger
Sent: Tuesday, April 04, 2000 10:26 AM
To: Orion-Interest
Subject: RE: Is CMP is useless?



a really great place to discuss or get information on this topic is sun's
EJB-INTEREST mailing list. the archives are full of extensive and mostly
very competent postings regarding this very design issue (CMP vs BMP vs
direct SQL) and many other general ejb design questions.

regards,

robert


At 09:10 04.04.00 , Alex Paransky wrote:
>But using stateless session beans to execute SQL means you have to embed
the
>SQL commands in to your code.  This breaks the model that CMP is trying to
>achieve.  If someone is to move your bean in to a different environment
they
>might not be able to alter the code to make changes to the SQL.
>
>Suppose that someone is trying to adapt your Employee bean to be used in
>their enterprise system.  They follow the CMP procedure with their EJB
>server to map Employee attributes to columns in their own table.  However,
>they are not able to do the same with the session bean which has SQL in it.
>
>I suppose that the bean's environment can be used to hold the specific SQL,
>with parameter replacements, however, this seems out of place with the CMP
>model.
>
>
>
>
>
>
>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de


Reply via email to