]
Ryan Gardner commented on HHH-4250:
-----------------------------------
Is there a workaround for this? It's a serious bug in that it blocks the bidirectional
mapping on a joined subclass.
@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
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: