openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Do mapped superclasses work at all in OpenJPA?
Date Tue, 13 Feb 2007 03:14:28 GMT
Hi Dain,

This might be related to a bug in xml overrides http:// 
issues.apache.org/jira/browse/OPENJPA-97. Just fer grins, do you have  
a way to annotate the mapped superclass?

Craig

On Feb 12, 2007, at 7:01 PM, Dain Sundstrom wrote:

> 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.pcGetManaged 
> FieldCount()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.createEntityMa 
> nager(EntityManagerFactoryImpl.java:187)
> 	at  
> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityMa 
> nager(EntityManagerFactoryImpl.java:52)
> 	at  
> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityManag 
> er(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

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message