Title: 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

Reply via email to