From: Andy J. (JIRA) <web...@jp...> - 2009-02-28 09:19:43
|
[ http://www.datanucleus.org/servlet/jira/browse/NUCRDBMS-115?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16269#action_16269 ] Andy Jefferson commented on NUCRDBMS-115: ----------------------------------------- Don't populate/initialise ANY other metadata from within populate/initialise of a different class. The only place this should be done is when we have a class and it populates/initialises its superclass. Adding populate/initialise of other classes will result in cyclic relations, and we just removed all such things just before 1.1.0. You only need to know if the particular class is persistable, so no need to do anything with the metadata is there? No problem with the basic approach of going up to superclasses and filling in the fields/properties default mapping info. > Support embedded inherited objects, and embedded reference/interface objects > ---------------------------------------------------------------------------- > > Key: NUCRDBMS-115 > URL: http://www.datanucleus.org/servlet/jira/browse/NUCRDBMS-115 > Project: DataNucleus RDBMS > Issue Type: New Feature > Components: Schema > Reporter: Martin Taal > Priority: Minor > Attachments: JPOXTC.zip > > > Hi, > I have a member which is declared in java with an interface type. This member should be embedded. I try to combine embedded with implementation-classes to let jpox know which implementation class I am using for the interface. The enhancer fails with the message that the member is declared with a type (the interface type) which is not persistence capable. Which is true as it is an interface. However because I also specify the implementation-classes extension I hoped that this would help, but it doesn't apparently. > Did I do something wrong in my metadata (see below) or is it possible for jpox to > use the implementation-classes also for embedded elements? > Thanks for any help here! > gr. Martin > <jdo> > <package name="org.elver.store.test.emf.annotations.component"> > <class name="ComponentOne" identity-type="datastore" requires-extent="true" > detachable="true" persistence-modifier="persistence-capable" > embedded-only="true" table="ComponentOne"> > <inheritance strategy="new-table"> > <discriminator column="CLASS_DISCRIMINATOR" strategy="class-name" index="true"/> > </inheritance> > <field name="firstName" persistence-modifier="persistent"> > </field> > <field name="age" persistence-modifier="persistent"> > </field> > <field name="hairColor" persistence-modifier="persistent" null-value="none"> > <column allows-null="true"/> > </field> > </class> > </package> > <package name="org.elver.store.test.emf.annotations.component.impl"> > <class name="ItemImpl" identity-type="datastore" requires-extent="true" > detachable="true" persistence-modifier="persistence-capable" table="Item"> > <implements name="org.elver.store.test.emf.annotations.component.Item"/> > <implements name="org.eclipse.emf.ecore.EObject"/> > <implements name="org.eclipse.emf.common.notify.Notifier"/> > <inheritance strategy="new-table"> > <discriminator column="CLASS_DISCRIMINATOR" strategy="class-name" index="true"/> > </inheritance> > <field name="emfComponent" persistence-modifier="persistent" dependent="true" delete-action="restrict" embedded="true"> > <extension vendor-name="jpox" key="implementation-classes" > value="org.elver.store.test.emf.annotations.component.impl.EMFComponentImpl" /> > <embedded> > <field name="firstName" persistence-modifier="persistent" null-value="exception"> > </field> > <field name="age" persistence-modifier="persistent"> > </field> > </embedded> > </field> > <field name="nonEmfComponent" persistence-modifier="persistent" dependent="true" delete-action="restrict"> > <collection element-type="org.elver.store.test.emf.annotations.component.ComponentOne" dependent-element="true"/> > <element> > <embedded> > <field name="firstName" persistence-modifier="persistent"> > </field> > <field name="age" persistence-modifier="persistent"> > </field> > </embedded> > </element> > <order column="ITEMNONEMFCOMPONENT_IDX"/> > <foreign-key delete-action="restrict" update-action="cascade"/> > </field> > </class> > <class name="EMFComponentImpl" identity-type="datastore" requires-extent="true" > detachable="true" persistence-modifier="persistence-capable" > embedded-only="true" table="EMFComponent"> > <implements name="org.elver.store.test.emf.annotations.component.EMFComponent"/> > <implements name="org.eclipse.emf.ecore.EObject"/> > <implements name="org.eclipse.emf.common.notify.Notifier"/> > <inheritance strategy="new-table"> > <discriminator column="CLASS_DISCRIMINATOR" strategy="class-name" index="true"/> > </inheritance> > <field name="firstName" persistence-modifier="persistent" null-value="exception"> > </field> > <field name="age" persistence-modifier="persistent"> > </field> > <field name="ageESet" persistence-modifier="persistent" null-value="none"> > <column allows-null="true"/> > </field> > </class> > </package> > </jdo> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://www.datanucleus.org/servlet/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |