[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (HHH-5836) Mapping collection of entities with same name and notnull constraints from two different entities results in duplicate property mapping of Backref

Milan Brich (JIRA) noreply at atlassian.com
Tue Mar 8 12:01:08 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=40137#action_40137 ] 

Milan Brich edited comment on HHH-5836 at 3/8/11 10:59 AM:
-----------------------------------------------------------

Yes it is also in 3.6.0, patch attached.

      was (Author: milanbr):
    yes it is also in 3.6.0 patch attached
  
> Mapping collection of entities with same name and notnull constraints from two different entities results in duplicate property mapping of Backref
> --------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5836
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5836
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations
>    Affects Versions: 3.5.6
>            Reporter: Milan Brich
>         Attachments: backref.patch, hibernate-backref-bug.zip
>
>
> When two entities have OneToMany relationship to third entity and the collection name is same in both entities and nullable is set to false. Then exception written below is thrown.
> Caused by: org.hibernate.MappingException: Duplicate property mapping of _parentsBackref found in cz.csas.persistence.test.Parent
> 	at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:483)
> 	at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:473)
> 	at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
> 	at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
> 	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
> 	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:892)
> 	... 58 more
> Attached annotated entities.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list