Hey
Murali Krishna Devarakonda wrote:
> Murali Krishna Devarakonda wrote:
> > The User bean's UserPK primary key class contains:
> > String login
> > String password
>
> Does this mean that in your system it is not allowed to change password?
> Because this is the consequence of the above.
>
> <MKD>
> What's stopping me from having a "changePassword( String password )" method?
> </MKD>
There's no way to change the primary key of an object in EJB. It's just
the way it is.
> I would use only "login" as primary key. If you're doing the above just
> for validation ("findByPrimaryKey" returns NotFound on invalid
> login/password combo) I would consider that a hack that will backfire
> some day (when user wants to change password). Do it some other way.
>
> <MKD>
> You are right. That's the idea- to validate password, and also to get a
> single User reference, instead of an Enumeration of 1 User that a
> findByLoginAndPassword(String login, String password) would return.
findByLoginAndPassword can return User. If several are found only the
first one should be returned.
/Rickard
--
Rickard �berg
@home: +46 13 177937
Email: [EMAIL PROTECTED]
Homepage: http://www-und.ida.liu.se/~ricob684
===========================================================================
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".