On 3/5/08 12:03 PM, "Andrus Adamchik" <andru..bjectstyle.org> wrote:
>
> On Mar 5, 2008, at 6:52 PM, Andrus Adamchik wrote:
>
>>> I have yet to map a relationship as a Set. Does the set
>>> implementation used preserve iteration order?
>>
>> No, it is a HashSet.
>
> But we can probably replace it with a LinkedHashSet I guess... Then
> the iteration order will match the List expectations (even if we add
> explicit relationship ordering per recent Jira). Then users can choose
> 'Set' for relationships they are planning to modify and
> 'List' (default) for the rest.
As alluded to in another thread, I'm even thinking of an internal Set
implementation that only does object identity and object ID comparisons.
Realistically, that's what I think people care about and what maps to the
object store. These should largely be fast operations and avoid any
overhead with logical equals implementations.
Of course, the problem there is that it would break the contract of Set.
This is something that I think is endemic to ORMs anyway . . . The
difference between object equality and object equivalence. We've had to
jump through some odd hoops to support both. I'm inclined to say buck the
Set spec and only concern ourselves with DB equality.
-- Kevin
This archive was generated by hypermail 2.0.0 : Wed Mar 05 2008 - 12:16:16 EST