added a comment - - edited
I think that it must be possible to have two keys ordering : the order isn't obligatory reversible.
For exemple with user and group :
- You can order groups for one user : with preference by exemple, or importance.
- And with a different order, users for a group : rank by example.
And maybe more, if you decide to add multi-order : an user show group by his rank in it, if his rank is identical, the order is make by love preference, and after by the importance given by the user (not necessary a number, if we imagine filter on them).
So a default order can be choice with parametized fields and could be :
@ManyToMany(targetEntity="Group")
...
@JoinFields ( rank: { type: int} , preference:{type:int}, importance:{type: string, length: 40} )
@OrderByJoinFields({"rank" = "ASC", "preference"="ASC", "importance"="ASC" } )
In this case the order must be optional and would be clean if another order appears in the same scope (DQL...). And manytomany became virtual entities act as other entities except they don't appears permetting in the same time a better conception.
So if the solution take in DDC-181 will become the only solution. This would a good idea to document this. Because, this seems to me a very important point.
My last point is even an unique ordering field created in the join table will be a big and usefull improvement.
Thank a lot for your beautiful work.
Hi, any news on this?
If I may add any info to this feature request, maybe something like JPA/Hibernate could be a good start?
See http://docs.oracle.com/javaee/6/api/javax/persistence/OrderColumn.html or http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-indexed
The idea in Hibernate is that you persist the order of the list in an extra column. This column is not a field of the entity however.