Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF+Teneo+ORM+JPA EAttribute with multi-valued eenum type
EMF+Teneo+ORM+JPA EAttribute with multi-valued eenum type [message #431912] Wed, 29 July 2009 11:24 Go to next message
Eclipse UserFriend
Originally posted by: jan.pfeil.pfeilweb.de

--nextPart3452683.hk5qWAgFLt
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7Bit

Hi experts,

I'm stuck with my ecore model while generating the ORM mapping for
eclipselink. I use an attribute of type EEnum with upperBound set to -1.
This gives me a perfect model so far, but when it comes to orm.xml the
attribute is not generated.

For demonstration I have modified the well known library model. See the
attached file books.ecore and notice the EAttribute tags. Tags is a copy of
the category attribute with upperBound set to -1 for multi-value behavior.

When persisting an instance as xml by using the generated model editor I get
something like this:

<Book>
<tags>Mystery</tags>
<tags>Biography</tags>
</Book>

Looks good to me. Now I use the GenerateORM class to generate the orm.xml
file (using the teneo eclipse plugin). What I get is this:

<orm:entity class="library.impl.BookImpl" name="Book">
<orm:table name="book"/>
<orm:inheritance strategy="JOINED"/>
<orm:attributes>
<orm:basic fetch="EAGER" name="title" optional="false"/>
<orm:basic fetch="EAGER" name="pages" optional="false"/>
<orm:basic fetch="EAGER" name="category" optional="false">
<orm:enumerated>ORDINAL</orm:enumerated>
</orm:basic>
....
</orm:entity>

So you can see the category attribute gets generated but the tags attribute
is completely missing. As soon as I change upperBound to 1 (tags
attribute) I get the same result as for category. So I infer it has
something to do with that.

Is it possible to use such a model with ORM persistence? Is there another
solution? What am I missing?

Ciao,
Jan

--nextPart3452683.hk5qWAgFLt
Content-Type: application/xml; name="books.ecore"
Content-Transfer-Encoding: base64
Content-Description:
Content-Disposition: attachment; filename="books.ecore"

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGVjb3Jl OkVQYWNrYWdlIHht
aTp2ZXJzaW9uPSIyLjAiCiAgICB4bWxuczp4bWk9Imh0dHA6Ly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j4KICAgICAgICA8ZGV0 YWlscyBrZXk9Imtp
bmQiIHZhbHVlPSJlbGVtZW50Ii8+CiAgICAgICAgPGRldGFpbHMga2V5PSJu YW1lIiB2YWx1ZT0i
bmFtZSIvPgogICAgICA8L2VBbm5vdGF0aW9ucz4KICAgIDwvZVN0cnVjdHVy YWxGZWF0dXJlcz4K
ICAgIDxlU3RydWN0dXJhbEZlYXR1cmVzIHhzaTp0eXBlPSJlY29yZTpFUmVm ZXJlbmNlIiBuYW1l
PSJib29rcyIgdXBwZXJCb3VuZD0iLTEiCiAgICAgICAgZVR5cGU9IiMvL0Jv b2siIGVPcHBvc2l0
ZT0iIy8vQm9vay9hdXRob3IiPgogICAgICA8ZUFubm90YXRpb25zIHNvdXJj ZT0iaHR0cDovLy9v
cmcvZWNsaXBzZS9lbWYvZWNvcmUvdXRpbC9FeHRlbmRlZE1ldGFEYXRhIj4K ICAgICAgICA8ZGV0
YWlscyBrZXk9ImtpbmQiIHZhbHVlPSJlbGVtZW50Ii8+CiAgICAgICAgPGRl dGFpbHMga2V5PSJu
YW1lIiB2YWx1ZT0iYm9va3MiLz4KICAgICAgPC9lQW5ub3RhdGlvbnM+CiAg ICA8L2VTdHJ1Y3R1
cmFsRmVhdHVyZXM+CiAgPC9lQ2xhc3NpZmllcnM+CjwvZWNvcmU6RVBhY2th Z2U+Cg==

--nextPart3452683.hk5qWAgFLt--
Re: EMF+Teneo+ORM+JPA EAttribute with multi-valued eenum type [message #431913 is a reply to message #431912] Wed, 29 July 2009 11:27 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5339
Registered: July 2009
Senior Member
Hi Jan,
This should be possible so seems a bug. Can you enter a bugzilla for this? Then I will solve this in the next build.

gr. Martin

equisitus wrote:
> Hi experts,
>
> I'm stuck with my ecore model while generating the ORM mapping for
> eclipselink. I use an attribute of type EEnum with upperBound set to -1.
> This gives me a perfect model so far, but when it comes to orm.xml the
> attribute is not generated.
>
> For demonstration I have modified the well known library model. See the
> attached file books.ecore and notice the EAttribute tags. Tags is a copy of
> the category attribute with upperBound set to -1 for multi-value behavior.
>
> When persisting an instance as xml by using the generated model editor I get
> something like this:
>
> <Book>
> <tags>Mystery</tags>
> <tags>Biography</tags>
> </Book>
>
> Looks good to me. Now I use the GenerateORM class to generate the orm.xml
> file (using the teneo eclipse plugin). What I get is this:
>
> <orm:entity class="library.impl.BookImpl" name="Book">
> <orm:table name="book"/>
> <orm:inheritance strategy="JOINED"/>
> <orm:attributes>
> <orm:basic fetch="EAGER" name="title" optional="false"/>
> <orm:basic fetch="EAGER" name="pages" optional="false"/>
> <orm:basic fetch="EAGER" name="category" optional="false">
> <orm:enumerated>ORDINAL</orm:enumerated>
> </orm:basic>
> ....
> </orm:entity>
>
> So you can see the category attribute gets generated but the tags attribute
> is completely missing. As soon as I change upperBound to 1 (tags
> attribute) I get the same result as for category. So I infer it has
> something to do with that.
>
> Is it possible to use such a model with ORM persistence? Is there another
> solution? What am I missing?
>
> Ciao,
> Jan


--

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
Previous Topic:cdo - unimplemented methods and missing repositories
Next Topic:Headless mode, project creation + code generation
Goto Forum:
  


Current Time: Sun Nov 23 12:34:58 GMT 2014

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

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