openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Do mapped superclasses work at all in OpenJPA?
Date Tue, 13 Feb 2007 06:42:23 GMT
Are you sure that is the right issue?  It seems to be about a  
different problem.

-dain

On Feb 12, 2007, at 7:14 PM, Craig L Russell wrote:

> 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.pcGetManage 
>> dFieldCount()I
>> java.lang.NoSuchMethodError:  
>> org.apache.openejb.test.entity.cmp.BasicCmpBean.pcGetManagedFieldCoun 
>> t()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.createEntityM 
>> anager(EntityManagerFactoryImpl.java:187)
>> 	at  
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityM 
>> anager(EntityManagerFactoryImpl.java:52)
>> 	at  
>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityMana 
>> ger(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