-
Bug
-
Resolution: Duplicate
-
Major
-
EJB 3.0 Beta 1
-
None
De EJB3 deployer does not load base classes that are annotated with @EmbeddableSuperclass.
The attempted mappings is as follows:
@EmbeddableSuperclass
public class DomainObject implements Serializable
{
private Long id;
@Id (generate = GeneratorType.AUTO)
public Long getId()
public void setId(Long id)
{ this.id = id; }}
@Entity
public class User extends DomainObject
{
private String name;
etc...
}
If I add the base class explicitly as is suggested in Hibernate JIRA issue EJB-17, to either persistence.xml or hibernate.cfg.xml, the entry is ignored. A closer examination of the source reveals that the EntityManagerFactoryLoader only adds the datasource and the property elements from the persistence.xml file, ignoring the rest.
I've tried the with the following persistence.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<entity-manager>
<name>manager1</name>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/factoryDS</jta-data-source>
<class>com.efactory.teamserver.domain.DomainObject</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.use_sql_comments" value="true"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
<property name="hibernate.transaction.flush_before_completion" value="false"/>
<property name="hibernate.transaction.auto_close_session" value="true"/>
<property name="hibernate.connection.autocommit" value="false"/>
</properties>
</entity-manager>