Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo/EclipseLink] @Embeddable support
[Teneo/EclipseLink] @Embeddable support [message #515289] Thu, 18 February 2010 11:15 Go to next message
Assen Sharlandjiev is currently offline Assen SharlandjievFriend
Messages: 17
Registered: January 2010
Location: Sofia, Bulgaria
Junior Member

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 13:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
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 14:52 Go to previous message
Assen Sharlandjiev is currently offline Assen SharlandjievFriend
Messages: 17
Registered: January 2010
Location: Sofia, Bulgaria
Junior Member

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: Thu Apr 25 00:58:51 GMT 2024

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

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

Back to the top