openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Sutter" <kwsut...@gmail.com>
Subject Re: Do mapped superclasses work at all in OpenJPA?
Date Tue, 13 Feb 2007 14:25:59 GMT
Just to add a "me too" to help out Dain...  I have also seen this problem
while debugging other problems.  At the time I figured I was doing something
wrong, so I didn't report it.  I'll see if I can reproduce it again and
provide more insights.

Kevin

On 2/13/07, Marc Prud'hommeaux <mprudhom@apache.org> wrote:
>
> Dain-
>
> I just did a quick test with a mapped-superclass using an orm.xml
> descriptor with all attributes defined in the superclass, and it
> worked fine for me.
>
> Are you using dynamic runtime enhancement, or build-time enhancement?
> Can you enable TRACE-level logging (by setting the "openjpa.Log"
> property to "DefaultLevel=TRACE"), and send us the output from your
> test run? Also, seeing your persistence.xml might help shed light on
> the issue...
>
>
>
> 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!
> >>
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message