We have a project need to sort details for one master record with JDK 1.3.
The details is mapping to Set with sort="natural".
We later find a problem in it. When getting details from master data, and then add one of the detail record(saved) to the Set, the set size been increased.
When I add debuging code to compare two elements in Set using "==", it return "true". The Set class is "net.sf.hibernate.collection.SortedSet".
What's the problem? I think Set can contains one object only once. But it seems not.
I have remove all sort="natural" in mapping files. And add a new SortIterateTag based on Struts IterateTag. Because I think "sort" is a concept of "view" for us, not a model level concept.
But I still can't understand why the Set can contains same object twice?
_________________ OR maping? not familar. seems easy select, hard delete/update
|