[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5732) @OrderColumn not updated if @OneToMany has mappedby defined

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Mar 21 12:08:49 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-5732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46044#comment-46044 ] 

Steve Ebersole commented on HHH-5732:
-------------------------------------

I at least have a test case now capable of reproducing this consistently (the attached one wont).  

Since y'all want to map this as inverse (mappedBy implies inverse) just realize that the solution here will require 2 writes.  You'd get one insert/update to manage the foreign key from the non-inverse side (this is what inverse means) and then a second update to manage the list position from the collection side.  This is exactly why we recommend lists (maps have same concern as well sometimes wrt the map key) be non-inverse.



> @OrderColumn not updated if @OneToMany has mappedby defined
> -----------------------------------------------------------
>
>                 Key: HHH-5732
>                 URL: https://hibernate.onjira.com/browse/HHH-5732
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: entity-manager
>    Affects Versions: 3.6.0
>            Reporter: Jaroslaw Lewandowski
>            Assignee: Steve Ebersole
>         Attachments: Screen shot 2011-01-10 at 21.41.27.png, TestOrderColumn.zip
>
>
> As I'm not able to reopen HHH-5378 I'm creating a new one. There is nothing said in JPA2.0 documentation that with @OrderColumn are any limitations regarding of usage mappedBy attribute on @OneToMany annotation. As I mentioned in the comments of that issue - even Hibernate documentation http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/collections.html#collections-indexed uses example which fails when executed with 3.6.0.Final version.
> Test case attached.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list