From: Frank A. <fr...@bu...> - 2005-12-15 13:19:49
|
ValueObject aggregationSubclass the VO and create a hashcode method there. -----Original Message----- From: xdo...@li... [mailto:xdo...@li...]On Behalf Of Paróczi Zsolt Sent: Thursday, 15 December 2005 8:49 PM To: xdo...@li... Subject: [Xdoclet-user] ValueObject aggregation I found the following problem: I have a master detail reltaion (the details are aggregated). If I add a detail to the master after add another detail with the same values but different reference. The value object code does not add the second detail object to the addedDetails it will be added only to the details collection. I debugged and found this : if (! this.onceAddedCarryItems.contains(added)) this.onceAddedCarryItems.add(added); if (! this.addedCarryItems.contains(added)) this.addedCarryItems.add(added); both conditions are false so I suppose that both VOs hashCode are the same and the Collection.contains method finds this object in the collection by its hashCode. My questions are that; Is it a normal behavior or bug? Where can I modify the VO's hashCode generator algorythm. Thanks, Zsolt Paroczi |