-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@OrderColumn does not work with @ManyToMany properties #1700
Comments
@rbygrave can you take a look at this issue and maybe give an estimation if you have time to fix that or give me some tips how I should try to fix it. |
Hi @rPraml . Can you let me know the impact of this on your project? I'm guessing we haven't got a good workaround for this and it's a problem? I'm thinking you'll maybe looked to map the intersection table explicitly and not using There are a bunch of things I have on the TODO list which I am hoping/wondering if I can look at first basically but I get the feeling we need to give this some attention. |
We currently use a separate m2m entity which 2 id columns and one order column as workaround |
Hi, is there any progress or work around on this issue? I notice that the list fetched by ebean seems to ignore the OrderColumn annotation entirely? Thank you |
No, sorry. This had a workaround so other things (performance monitoring in particular) have taken precedence.
The workaround to date is to model as 2 OneToMany (so model the intersection/bridge explicitly).
Yes. Cheers, Rob. |
Hi Rob, is there other workaround now? or do we still need to do 2 OneToMany relationship as stated above? |
No, there isn't a fix for this yet and so we really only have the workaround of modelling as 2 OneToMany relationship. |
Same for element collection (#2393) but for that case we can't define PK on the table which is lead to poor database consistency... Also, no workaround for element collection exists. Any chance to support |
Actual behavior
@OrderColumn is ignored on ManyToMany lists. According to the documentation, this should be supported:
Expected behavior
Defining @OrderColumn on a M2M property like this
should result in an additional column in the DDL script.
(and of course, Ebean should maintain that order column like it is done in OneToMany, see TestOrderedList)
Steps to reproduce
Add the above annotation in misc.migration.v1_1.MtmChild and run the DbMigrationGenerateTest
The generated DDLs do not contain information about an order-column
The text was updated successfully, but these errors were encountered: