Hi,
I have a User(CMP Entity) Bean in WebLogic 4.5 Server, representing a
table in Oracle8.
In the DB, User, among other fields, has:
USER_ID NOT NULL NUMBER(38) (Primary key generated
using Oracle sequences)
LOGIN VARCHAR2(20)
PASSWORD VARCHAR2(20)
The User bean has members corresponding to all the fields, and so does a
UserInfo class.
The User bean's UserPK primary key class contains:
String login
String password
I also have ONE ejbCreate(UserInfo userInfo)
I want to be able to do the following
1. Create user accounts by supplying the UserInfo, using ejbCreate,
containing valid values for all fields, except 'userId' (it will be
generated in the database).
2. Login a user by supplying the 'login' and 'password', using
findByPrimaryKey(UserPK userPK).
I didn't make the 'userId' field my EJB primary key(or even a part of
it) because I'm using CMP, and the User Bean doesn't control it directly.
Does this mean that the 'userId' field can't be one of the
ContainerManagedFields?
I would like the container to READ the 'userId', but I not CREATE or
MODIFY it.
If I can't do that, and therefore leave out 'userId' from the
ContainerManagedFields, then I can't have
findByUserId( String userId )
Also, I would be responsible for reading the 'userId' field using JDBC
if I wanted to support:
getUserID( String userId )
Is there's a better solution, as long as I want to stick with CMP. Or do
I have to do BMP?
Or should I make this User just a session bean/plain-java class?
(Just for argument's sake- I realize that there are other more important
reasons to consider for the Entity-Bean/Session-Bean/not-an-EJB argument).
Thanks for your input.
Regards,
Murali Krishna Devarakonda
===========================================================================
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".