vohoaiviet / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
0 stars 0 forks source link

Order by null or not-null on an entity relationship #42

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
There is no way to order the results based on if a relationship exists or
not.  I'd like to create a sorted list of entities, with all of the
entities that do not have a relation with another entity sorted together.

For instance, there is a 1-to-1 relationship between a Game (i.e. a soccer
game) and a FieldSlot (i.e. a time span that a soccer field is available).
 A game and a fieldslot can exist separately without be associated.  There
should be a way to list all games, and order them so that the ones that
haven't been assigned to a fieldslot are listed first. This currently isn't
possible.

Furthermore, I'd like to be able to order the games that do have fieldslots
by properties within the fieldslot, such as Fieldslot.startTime.  That way,
all games would be listed, with those games that don't have fieldslots
listed first, then the rest of the games ordered by their
fieldslot.startTime value.

See this mailing list thread (around the 7th or 8th post) in this topic for
more details:
http://groups.google.com/group/java-generic-dao/browse_thread/thread/8010f6f7176
59c4d

Original issue reported on code.google.com by yowza...@gmail.com on 6 Aug 2009 at 9:57