Embedded Elements in ORM Mapping

This is a discussion on Embedded Elements in ORM Mapping within the Apache forums in Application Servers & Tools category; Hi, I used OpenJPA because I can't realized the mapping with annotations. So I use the orm.xml for my mapping. Now my Problem: I have an other class in my entity which contains an other class. But I can't found the embedded element in an embedded element into orm_1_0.xsd. How I can write this mapping in the orm.xml ? RootClass { int id Subclass sub .... } Subclass { Subsubclass subsub .... } Subsubclass { basic types like int and string } my wrong orm.xml which not work: <entity class="RootClass"> <attributes> <embedded name="sub" /> </attributes> </entity> <embeddable class="Subclass"> <attributes> <embedded ...

Go Back   Application Development Forum > Application Servers & Tools > Apache

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-17-2008, 05:24 AM
PLC_David
Guest
 
Default Embedded Elements in ORM Mapping


Hi,

I used OpenJPA because I can't realized the mapping with annotations.
So I use the orm.xml for my mapping.

Now my Problem: I have an other class in my entity which contains an other
class.
But I can't found the embedded element in an embedded element into
orm_1_0.xsd.

How I can write this mapping in the orm.xml ?


RootClass {

int id
Subclass sub
....
}


Subclass {

Subsubclass subsub
....
}

Subsubclass {

basic types like int and string
}

my wrong orm.xml which not work:

<entity class="RootClass">
<attributes>
<embedded name="sub" />
</attributes>
</entity>

<embeddable class="Subclass">
<attributes>
<embedded name="subsub" /> <--- this is not accept with
the xsd
</attributes>
</entity>

<embeddable class="Subsubclass">
<attribute>
< ...>
</attribute>
</embeddable>


So I hope anybody can help me.
--
View this message in context: http://n2.nabble.com/Embedded-Elemen...9p1094739.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Reply With Quote
  #2  
Old 09-17-2008, 08:51 AM
Frank Schwarz
Guest
 
Default Re: Embedded Elements in ORM Mapping


There is no way to express nested embeddeds just with a orm.xml file.
Actually there quite a few restrictions with orm.xml as there is no way to
express vendor extension (like in the old JDO way).

JPA 2.0 is supposed to deliver nested embeddeds. However I would not wait on
this. The JPA2.0 expert group promised the final release to available by the
end of 2008. Thats pretty tough if you take into account that the public
review still lacks some of the big items (e.g. the criteria query api).

I wonder when JPA-providers will start to deviate from the specification
allowing other orm-xml-schemas that better serve the users needs and the
capabilities of the implementation.

-- Frank


PLC_David wrote:
>
> Hi,
>
> I used OpenJPA because I can't realized the mapping with annotations.
> So I use the orm.xml for my mapping.
>
> Now my Problem: I have an other class in my entity which contains an other
> class.
> But I can't found the embedded element in an embedded element into
> orm_1_0.xsd.
>
> How I can write this mapping in the orm.xml ?
>


--
View this message in context: http://n2.nabble.com/Embedded-Elemen...9p1095156.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:30 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.