[hibernate-issues] [Hibernate-JIRA] Issue Comment Edited: (HHH-5359) Derived entity usecase fails when the association is bidirectional

Emmanuel Bernard (JIRA) noreply at atlassian.com
Fri Jan 14 05:41:05 EST 2011


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

Emmanuel Bernard edited comment on HHH-5359 at 1/14/11 4:40 AM:
----------------------------------------------------------------

Yes the fix makes sense to me and is consistent with HbmBinder even if it's hard to see.

      was (Author: emmanuel):
    Yes the fix makes sense to me.= and is consistent with HbmBinder even if it's hard to see.
  
> Derived entity usecase fails when the association is bidirectional
> ------------------------------------------------------------------
>
>                 Key: HHH-5359
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5359
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: entity-manager
>    Affects Versions: 3.5.3
>            Reporter: Hardy Ferentschik
>            Assignee: Gail Badner
>             Fix For: 3.6.1
>
>         Attachments: HHH-5359-Testcase.patch
>
>
> See https://forum.hibernate.org/viewtopic.php?f=9&t=1005649
> The exception is 
> {noformat}
> org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: org.hibernate.test.annotations.derivedidentities.bidirectional.Dependent.emp in org.hibernate.test.annotations.derivedidentities.bidirectional.Employee.dependents
> 	at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:655)
> 	at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:619)
> 	at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
> 	at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1221)
> 	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:383)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
> 	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
> 	at org.hibernate.test.annotations.TestCase.buildConfiguration(TestCase.java:114)
> 	at org.hibernate.test.annotations.HibernateTestCase.setUp(HibernateTestCase.java:133)
> 	at org.hibernate.test.annotations.HibernateTestCase.runBare(HibernateTestCase.java:80)
> 	at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:64)
> {noformat}
> The mapping is as follows:
> {code}
> @Entity
> public class Employee {
> 	@Id
> 	long empId;
> 	String empName;
> 	@OneToMany(mappedBy = "emp", fetch = FetchType.LAZY)
> 	private Set<Dependent> dependents;
> }
> {code}
> {code}
> @Entity
> //@IdClass(DependentId.class)
> public class Dependent implements Serializable {
> 	@Id
> 	@ManyToOne
> 	Employee emp;
> 	String name;
> }
> {code}
> It does not work with @IdClass either.

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