
| Key: |
CORE-2567
|
| Type: |
New Feature
|
| Status: |
Open
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Martin Taal
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
JPOX Core
Created: 31/Oct/05 06:24 PM
Updated: 19/Aug/07 09:59 PM
|
|
| Component/s: |
JDO,
Datastore Support
|
| Affects Version/s: |
1.1.0-rc-1
|
| Fix Version/s: |
None
|
|
|
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>
|
|
Description
|
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> |
Show » |
|