[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-4250) @ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)

Sharath Reddy (JIRA) noreply at atlassian.com
Tue Jul 6 08:48:14 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sharath Reddy resolved HHH-4250.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.6
                   3.5.x

> @ManyToOne - @OneToMany doesn't work with @Inheritance(strategy= InheritanceType.JOINED)
> ----------------------------------------------------------------------------------------
>
>                 Key: HHH-4250
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4250
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations
>         Environment: Hibernate Core 	 3.3.1.GA
> Hibernate Annotations 	3.4.0 GA
> Hibernate EntityManager 	3.4.0 GA 
> Jboss 4.3 EAP, 
> DB2 9.5
>            Reporter: Tomaz Cerar
>            Assignee: Sharath Reddy
>             Fix For: 3.5.x, 3.6
>
>         Attachments: patch.zip, TestCaseHHH4250.zip
>
>
> I am trying to create bidirectional association between two entities in which one can be Inherited and it fails with table not found:
> 11:37:39,229 ERROR [AssertionFailure] [] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
> org.hibernate.AssertionFailure: Table CRM.CRM_AKTIVNOST_DOGODKI not found
>         at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:480)
>         at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:259)
>         at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:87)
>         at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:261)
>         at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
>         at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
>         at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
>         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)
>         at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
> The code looks like this:
> @Entity
> @Table(name = "CRM_AKTIVNOST")
> public class Aktivnost implements Serializable {
> private List<Dogodek>       dogodki;
> ....
> ....
> @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL,mappedBy = "aktivnost")
> public List<Dogodek> getDogodki() {
>         return dogodki;
> }
> public void setDogodki(List<Dogodek> dogodki) {
>         this.dogodki = dogodki;
> }
> ...
> ...
> }
> @Entity
> @Table(name = "CRM_DOGODEK")
> @Inheritance(strategy= InheritanceType.JOINED)
> public class Dogodek implements Serializable {
> ...
> ...
> private Aktivnost aktivnost;
> ....
> ....
> @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
> 	@JoinTable(name = "CRM_AKTIVNOST_DOGODKI", joinColumns = {@JoinColumn(name = "DOGODEK_ID")}, inverseJoinColumns = {@JoinColumn(name = "AKTIVNOST_ID")})
> 	public Aktivnost getAktivnost() {
> 		return aktivnost;
> 	}
> 	public void setAktivnost(Aktivnost aktivnost) {
> 		this.aktivnost = aktivnost;
> 	}
> ...
> }

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