Think in relational, could you do it? You need a way to identify the
user or any other class. Any entity will have at least one field to
identify it.
If you have any case in which isn't possible (i don't think) post it.
El mar, 02-08-2005 a las 11:30 -0600, Maciej Gawinecki escribi??:
> Imagine the situation from client side of DAO Design Pattern
>
> class User {
> String name;
> int userID;
> ...
> }
>
>
> ...
> User user = UserDAO.findUser(UserID);
> user.setName("Johny");
> UserDAO.updateUser(user);
> ...
>
> In what a way UserDAO could guess which record in DB should be updated, if
> information contained in 'user' class are ambiguous, e.g. supposing there
> doesn't exist any unique primary key like userID?
>
> Any help would be appreciated,
>
> Maciej
>
> ====================================================================
> Companion Site: http://www.corej2eepatterns.com
> J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
> List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
> Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)