[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4821) Using two @ManyToOne in a @Entity generates an error

Benoit Coppens (JIRA) noreply at atlassian.com
Wed Jan 20 10:11:35 EST 2010


Using two @ManyToOne in a @Entity generates an error
----------------------------------------------------

                 Key: HHH-4821
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4821
             Project: Hibernate Core
          Issue Type: Bug
          Components: annotations
    Affects Versions: 3.3.0.SP1
         Environment: hibernate-core-3.3.2.GA, hibernate-annotations-3.4.0.GA, hibernate-c3p0-3.3.2.GA, hsqldb-1.8.0.10.jar
            Reporter: Benoit Coppens
         Attachments: manyToOne.zip

Mapping a child entity collection from two different parent entities results in duplicate backref property exception when configuring the session factory. Error log is:

org.hibernate.MappingException: Duplicate property mapping of _mappingsBackref found in domain.AttributeMapping
 at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:477)
 at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:467)
 at org.hibernate.mapping.RootClass.validate(RootClass.java:215)
 at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)
 at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)
 at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
 at hibernate.Insert.main(Insert.java:22)

Seems to be the same kinf of issue as HHH-2598

Attached project reproduces the issue

-- 
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