Skip to main content



      Home
Home » Modeling » EMF » [Teneo/EclipseLink] @Embeddable support
[Teneo/EclipseLink] @Embeddable support [message #515289] Thu, 18 February 2010 06:15 Go to next message
Eclipse UserFriend
Is the @Embeddable annotation supported by Teneo/EclipseLInk?

I've annotated a class with teneo.jpa annotation @Embeddable and containment a reference to it with teneo.jpa @Embedded.

However in the generated ORM I only see the reference:

<entity ...>
  <embedded name="contact"/>
</entity>


and I can't find an
<embeddable class="...Contact"/>


any ideas?

Assen.
Re: [Teneo/EclipseLink] @Embeddable support [message #515333 is a reply to message #515289] Thu, 18 February 2010 08:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi Assen,
Sounds like a bug/missing feature. Can you enter a bugzilla for this? I hope to solve this and a some other issues early
next week.

gr. Martin

Assen Sharlandjiev wrote:
> Is the @Embeddable annotation supported by Teneo/EclipseLInk?
>
> I've annotated a class with teneo.jpa annotation @Embeddable and
> containment a reference to it with teneo.jpa @Embedded.
>
> However in the generated ORM I only see the reference:
>
>
> <entity ...>
> <embedded name="contact"/>
> </entity>
>
>
> and I can't find an <embeddable class="...Contact"/>
>
> any ideas?
>
> Assen.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo/EclipseLink] @Embeddable support [message #515353 is a reply to message #515333] Thu, 18 February 2010 09:52 Go to previous message
Eclipse UserFriend
Hi Martin,

It looks more like a missing feature. I'll enter a bugzilla for this one, and for another one I found..

In the meantime, I'll share a possible solution:

1. Create an EClass ( the one that will be embedded - ex. Address)
2. Annotate the embeddable EClass with teneo.jpa: value -> @Embeddable - this will make the ORM generator to skip generation for entity mapping for this class.
3. Create an EDataType whose instance type name is the generated embeddable EClass implementation (ex. AddressImpl, call it EmbeddableAddress)
4. In the EClass that will have the embedded EClass, add a new child EAttribute whose EType is the EDataType from point 3 (EmbeddableAddress).
5. Manually add an <embedded /> attribute to the ORM mapping of the class from point 4.
6. Manually add the <embeddable /> element for the EClass implementation of the embeddable EClass.

This workaround may not be the best solution, but it appears to work as expected..

I was not able to use reference (EClass -> Embeddable EEClass) in the model, because the <embeddable /> mapping requires a class name, while the reference is declared with the interface of the embeddable class. I was wondering if there's a way to force the EMF model generator to suppress the interface generation on a given EClass only. Do you know?

Cheers,
Assen.
Previous Topic:Properties view
Next Topic:Model refactoring and data Binding
Goto Forum:
  


Current Time: Mon Jul 07 09:33:12 EDT 2025

Powered by FUDForum. Page generated in 0.05272 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top