openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Do mapped superclasses work at all in OpenJPA?
Date Tue, 13 Feb 2007 03:01:36 GMT
When I try to use a simple mapped super class with a trivial sub  
class (no fields or methods), I get the following exception:

ERROR - The bean instances business method encountered a system  
exception:org.apache.openejb.test.entity.cmp.BasicCmpBean.pcGetManagedFi 
eldCount()I
java.lang.NoSuchMethodError:  
org.apache.openejb.test.entity.cmp.BasicCmpBean.pcGetManagedFieldCount 
()I
	at openejb.org.apache.openejb.test.entity.cmp.BasicCmpBean.<clinit> 
(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:242)
	at org.apache.openjpa.meta.MetaDataRepository.classForName 
(MetaDataRepository.java:1224)
	at org.apache.openjpa.meta.MetaDataRepository.loadPersistentTypes 
(MetaDataRepository.java:1212)
	at  
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings 
(JDBCBrokerFactory.java:145)
	at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl 
(JDBCBrokerFactory.java:127)
	at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker 
(AbstractBrokerFactory.java:164)
	at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker 
(DelegatingBrokerFactory.java:139)
	at  
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMana 
ger(EntityManagerFactoryImpl.java:187)
	at  
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMana 
ger(EntityManagerFactoryImpl.java:52)
	at  
org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManager 
(JtaEntityManagerRegistry.java:105)


Which seems to indicate to me that OpenJPA isn't enhancing the mapped  
super class.  Does OpenJPA support mapped super classes?

Here is are my entity mappings:

<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"  
version="1.0">
     <mapped-superclass  
class="org.apache.openejb.test.entity.cmp.BasicCmpBean">
         <attributes>
             <id name="primaryKey"/>
             <basic name="firstName"/>
             <basic name="lastName"/>
             <transient name="nextId"/>
             <transient name="ejbContext"/>
             <transient name="allowedOperationsTable"/>
         </attributes>
     </mapped-superclass>
     <entity name="BasicCmpBean"  
class="openejb.org.apache.openejb.test.entity.cmp.BasicCmpBean">
         <description>BasicCmpBean</description>
         <attribute-override name="primaryKey">
             <column name="primaryKey"/>
         </attribute-override>
         <attribute-override name="firstName">
             <column name="firstName"/>
         </attribute-override>
         <attribute-override name="lastName">
             <column name="lastName"/>
         </attribute-override>
     </entity>
</entity-mappings>


Thanks for any help,

-dain

Mime
View raw message