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.

-AP_

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Galina
Sokolova
Sent: Tuesday, April 04, 2000 8:40 AM
To: Orion-Interest
Subject: RE: Is CMP is useless?



>From my experience stateless session bean is a better choice for complex
lookups, especially
if they return enumeration of objects.






[EMAIL PROTECTED] (Josh Sanderson)@itglink.com> on 04/04/2000 10:49:17
AM

To:   Orion-Interest <[EMAIL PROTECTED]>
cc:

Subject:  RE: Is CMP is useless?


I don't know....I never thought Employees and sex mixed that well
anyways....

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, April 03, 2000 9:04 PM
To: Orion-Interest
Subject: Is CMP is useless?


Is it my imagination, but the minute any kind of complex finding is
required
on an entity bean, CMP becomes useless.  For example, I have entities
called
EMPLOYEE, PERSON, and SEX (M/F/Other you know).

EMPLOYEE is a PERSON with SEX.

I have a function in EmployeeHome, findFemaleEmployees().  How do I
implement this with CMP?  The query has to do something like:

SELECT EMPLOYEE_ID FROM EMPLOYEE, PERSON, SEX WHERE SEX.TYPE="F" AND
EMPLOYEE.ID=PERSON.ID AND PERSON.SEX_ID = SEX.ID

Please note that SEX.ID is not the same as SEX.TYPE.

Can this be done with CMP or do I need to use BMP?  If the answer is use
BMP
(and this is such a TRIVIAL) example, that it seems CMP is pretty much
useless.

-AP_










Reply via email to