Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Text mapping instead of VarChar
[Teneo] Text mapping instead of VarChar [message #103060] Sun, 18 November 2007 20:46 Go to next message
Eclipse UserFriend
Originally posted by: irbull.cs.uvic.ca

I am creating my Database schema directly from my ECore model (by
passing my ePackage to the hdbs and then calling initialize). All my
String attributes get mapped to columns of type VarChar(255). I have
one attribute that needs more room than this. Is there any easy was to
say (maybe through an EAnnotation) that this database column should be
Text instead of VarChar?

Cheers,
Ian
Re: [Teneo] Text mapping instead of VarChar [message #103080 is a reply to message #103060] Sun, 18 November 2007 20:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
You can set the @Lob annotation on the efeature. If the edatatype is a string (its instanceclass ==
String.class) then the system should map this as text.
Another way is setting a @Column(length=1000) annotation.

gr. Martin

Ian Bull wrote:
> I am creating my Database schema directly from my ECore model (by
> passing my ePackage to the hdbs and then calling initialize). All my
> String attributes get mapped to columns of type VarChar(255). I have
> one attribute that needs more room than this. Is there any easy was to
> say (maybe through an EAnnotation) that this database column should be
> Text instead of VarChar?
>
> Cheers,
> Ian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Text mapping instead of VarChar [message #103096 is a reply to message #103080] Sun, 18 November 2007 21:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: irbull.cs.uvic.ca

WOW! Thanks for the quick response Martin!

Just in case someone else stumbles upon this post, to do this (on your
Ecore file)

1. Select the EAttribute you wish to add the annotation to
2. Add an EAnnotation (with source set to teneo.jpa)
3. Add a details entry
4. set the key to "value"
5. Set the value to "@Lob"

(and don't forget to regenerate your model :) )

Thanks again Martin,

Cheers,
Ian

Martin Taal wrote:
> You can set the @Lob annotation on the efeature. If the edatatype is a
> string (its instanceclass == String.class) then the system should map
> this as text.
> Another way is setting a @Column(length=1000) annotation.
>
> gr. Martin
>
> Ian Bull wrote:
>> I am creating my Database schema directly from my ECore model (by
>> passing my ePackage to the hdbs and then calling initialize). All my
>> String attributes get mapped to columns of type VarChar(255). I have
>> one attribute that needs more room than this. Is there any easy was
>> to say (maybe through an EAnnotation) that this database column should
>> be Text instead of VarChar?
>>
>> Cheers,
>> Ian
>
>
icon14.gif  Re: [Teneo] Text mapping instead of VarChar [message #486810 is a reply to message #103096] Sat, 19 September 2009 12:39 Go to previous messageGo to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 51
Registered: July 2009
Member
Thank you very much Ian, your post is great!!
I was beginning to think that editing the ecore xml was the only way.

I didn't find any documentation about handling these options with the ecore Editor. Do someone have some useful link about this?
Thank you
Vincenzo Caselli

[Updated on: Sat, 19 September 2009 12:44]

Report message to a moderator

Re: [Teneo] Text mapping instead of VarChar [message #486828 is a reply to message #486810] Sat, 19 September 2009 15:51 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Vincenzo,
The title of the post and the content don't seem in sync....

Also support for Teneo is given on the emf newsgroup: eclipse.tools.emf

gr. Martin

Vincenzo Caselli wrote:
> Thank you very much Ian, your post is great!!
> I was beginning to think that editing the ecore xml was the only way.
> I attached an image to make your steps more clear (if possible). I
> didn't find any documentation about handling these options with the
> ecore Editor. Do someone have some useful link about this?
> Thank you
> Vincenzo Caselli


--

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] Text mapping instead of VarChar [message #612582 is a reply to message #103060] Sun, 18 November 2007 20:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
You can set the @Lob annotation on the efeature. If the edatatype is a string (its instanceclass ==
String.class) then the system should map this as text.
Another way is setting a @Column(length=1000) annotation.

gr. Martin

Ian Bull wrote:
> I am creating my Database schema directly from my ECore model (by
> passing my ePackage to the hdbs and then calling initialize). All my
> String attributes get mapped to columns of type VarChar(255). I have
> one attribute that needs more room than this. Is there any easy was to
> say (maybe through an EAnnotation) that this database column should be
> Text instead of VarChar?
>
> Cheers,
> Ian


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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] Text mapping instead of VarChar [message #612584 is a reply to message #103080] Sun, 18 November 2007 21:34 Go to previous message
Ian Bull is currently offline Ian BullFriend
Messages: 145
Registered: July 2009
Senior Member
WOW! Thanks for the quick response Martin!

Just in case someone else stumbles upon this post, to do this (on your
Ecore file)

1. Select the EAttribute you wish to add the annotation to
2. Add an EAnnotation (with source set to teneo.jpa)
3. Add a details entry
4. set the key to "value"
5. Set the value to "@Lob"

(and don't forget to regenerate your model :) )

Thanks again Martin,

Cheers,
Ian

Martin Taal wrote:
> You can set the @Lob annotation on the efeature. If the edatatype is a
> string (its instanceclass == String.class) then the system should map
> this as text.
> Another way is setting a @Column(length=1000) annotation.
>
> gr. Martin
>
> Ian Bull wrote:
>> I am creating my Database schema directly from my ECore model (by
>> passing my ePackage to the hdbs and then calling initialize). All my
>> String attributes get mapped to columns of type VarChar(255). I have
>> one attribute that needs more room than this. Is there any easy was
>> to say (maybe through an EAnnotation) that this database column should
>> be Text instead of VarChar?
>>
>> Cheers,
>> Ian
>
>
Re: [Teneo] Text mapping instead of VarChar [message #621384 is a reply to message #103096] Sat, 19 September 2009 12:39 Go to previous message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 51
Registered: July 2009
Member
Thank you very much Ian, your post is great!!
I was beginning to think that editing the ecore xml was the only way.
I attached an image to make your steps more clear (if possible).
I didn't find any documentation about handling these options with the ecore Editor. Do someone have some useful link about this?
Thank you
Vincenzo Caselli
Re: [Teneo] Text mapping instead of VarChar [message #621385 is a reply to message #621384] Sat, 19 September 2009 15:51 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Vincenzo,
The title of the post and the content don't seem in sync....

Also support for Teneo is given on the emf newsgroup: eclipse.tools.emf

gr. Martin

Vincenzo Caselli wrote:
> Thank you very much Ian, your post is great!!
> I was beginning to think that editing the ecore xml was the only way.
> I attached an image to make your steps more clear (if possible). I
> didn't find any documentation about handling these options with the
> ecore Editor. Do someone have some useful link about this?
> Thank you
> Vincenzo Caselli


--

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:Which EMFT should I use to output SVG?
Next Topic:Re: [MWE] Is there a way to prevent to refresh the *entire* workspace after the run of a workflow?
Goto Forum:
  


Current Time: Thu Apr 18 18:04:51 GMT 2024

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

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

Back to the top