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 18:19:11 GMT
Hi Dain,

Sorry for not being clear. My comment was supposed to be about xml  
bugs in general.

The annotations are very well tested in the TCK; the xml "overrides"  
are reputedly less well tested, so it's likely that there are bugs to  
be found in implementations, even if they pass the TCK. I have seen  
several bugs reported in OpenJPA related to xml processing, and  
included an example. I see that Marc has also filed an xml-related  
issue just last night.

Craig

On Feb 12, 2007, at 10:42 PM, Dain Sundstrom wrote:

> 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.pcGetManag 
>>> edFieldCount()I
>>> java.lang.NoSuchMethodError:  
>>> org.apache.openejb.test.entity.cmp.BasicCmpBean.pcGetManagedFieldCou 
>>> nt()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.createEntity 
>>> Manager(EntityManagerFactoryImpl.java:187)
>>> 	at  
>>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntity 
>>> Manager(EntityManagerFactoryImpl.java:52)
>>> 	at  
>>> org.apache.openejb.persistence.JtaEntityManagerRegistry.getEntityMan 
>>> ager(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!
>>
>

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