-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Suggestion for Dynamically-Assigned Comparator Support
PostPosted: Fri Aug 27, 2004 2:25 pm 
Newbie

Joined: Wed Aug 04, 2004 4:16 pm
Posts: 12
Location: UCSC
Hello,
I have a suggestion for a possible new feature of Hibernate that
I think is integratable with the current system architecture, is not
that "large" of a change but that would require small changes to
several different files/documents.

I propose a new value for the "sort" tag:
<set
sort = "unsorted" | "natural" | className | "use_current"
/>

During the creation of a new persistent object, the
sort value is used to assign a comparator in the construction
of the new SortedSet. For a statically assigned comparator
the previously created instance is retrieved; for the natural
ordering no comparator is used, as is currently done. In
the case of the "use_current" option, the set object can
return its comparator, which can then be used to create
the new persistent SortedSet. For retrieval from the database,
the containing class table would need an extra column
containing the name of the comparator class -- this would
allow an entity to contain multiple sets each with a different
comparator. For consistency with the current architecture,
I'm not sure if this extra column has many other implications.
It seems as though the comparator-name column could be
populated at the same time that the set is populated, without
affecting much other code.

I would love to make a patch and give a demonstration,
but it will take a while because I don't currently have very
much free time -- I'm posting this here because I think more
comments on the feasibility and the architectural implications
are necessary and because perhaps someone else who is
interested in this sort of support may have a lot more
free time than me. *smile*. I hope that the comments I
do get on this proposal help me better design a planned
patch.

Thanks for your time,
Jennifer Bevan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.