2-2. "Prolongation" (in footbal (the real one) term) I don't know now ... Parameter ? equals-type="pk/all" For sure I will add the PK class in the DO. getter only (? the PK setting is a entity bean responsability). On my VO stuffs I will not (and can not) take any assumption on how equals will be implemented. Agree or too much "power to user" will be confusing ?
> Agree. I'm already doing that in my modified template. I also like > Dmitri's isIdentical for doing "deep equals()". > > Maybe the best solution is to let DO hold an instance of the PK class > (not key fields). Two good points about it: > - Since there's no setPK in EJB there's no fear of changing a key > field > in setData/etc > - DO.equals() can delegate to PKClass.equals(), and hashcode/etc > > I do think DO should follow the same identity rules of ejb. It's just > a > memento of the bean, so the way equals() works currently is confusing > imho. That was my impression as well,but I can understand the one of Dmitri and David also. Vincent > > Ara. > > > Today equals() method of DataObjects returns true if all attributes > > internal of the DO are equals. > > I would prefer to see it true only if the attributes that are part > of > > the PK are equals. > > If you put one instance of a DO refering an entity A in a List. > Then > > want later to get it from the list, I espect that the find will be > done > > on the PK attributes only. Supposing my DO changes in middle some > > internal attributes I am still referring the same "entity". > > I find this requirement more logical from the "user" of the DO. > > If PK fields are null, equals would return false. > > Now I understand also the need to compare all attributes. I think > about > > a isIdentical method that will return true if pk attributes are not > null > > and all other attributes are equals. > > For the hashCode I would do the same as today but only of pk > attributes. > > What do you think ? > > > > Vincent > > __________________________________________________ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
