Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Texo: How to annotate database data type?(Annotation for long strings needed)
Texo: How to annotate database data type? [message #871992] Tue, 15 May 2012 09:03 Go to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
In my class there is element that java type is String but it should be longer than varchar(255) - default value. I would like to have more than 15000 characters. How to annotate this?
Re: Texo: How to annotate database data type? [message #872004 is a reply to message #871992] Tue, 15 May 2012 09:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Olaf,
Create an annotation model (right click on the ecore file and then through the texo submenu create one), create an empty
annotation model first, open it in the editor,
then right click on the top node, do new child, create an epackage child, set the epackage property to the epackage you
want to annotate
right click on the epackage, new child, eclass, for the eclass you want to annotate, set the eclass property,
right click on the eclass, new child, eattribute, for the eattribute you want to annotated, set the eattribute property
right click on the eattribute, new child, orm annotation
right click on the orm annotation, new child, Basic
right click on the new basic node, column,
set the length property of the column

See the attached screenshot for an example.

Note: you can always change the generated code also, so if you only have some minor extra things in model elements which
will never change then go to the generated code, find the field/getter/setter with the orm annotation, change the
javadoc: @generated to @generatedNOT and then add a @Column annotation manually in the java code.

gr. Martin

On 05/15/2012 11:03 AM, Olaf Burdziakowski wrote:
> In my class there is element that java type is String but it should be longer than varchar(255) - default value. I would
> like to have more than 15000 characters. How to annotate this?


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Texo: How to annotate database data type? [message #872022 is a reply to message #872004] Tue, 15 May 2012 10:23 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
Thank you Martin, it is working properly. (I found all path except the Column under Basic before).
I solved in the same way problems for elements with restricted SQL names: "to" changed to "_to". Is is preferred way?
Re: Texo: How to annotate database data type? [message #872087 is a reply to message #872022] Tue, 15 May 2012 12:34 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Olaf,
I entered a bugzilla for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=379532

But after some research I think you can solve it also using a global ORM specific option without renaming column names.
I asked a question on the eclipselink newsgroup to see if there is a global option which can be used for this. Hibernate
has such an option.

I added a wiki entry for this also:
http://wiki.eclipse.org/Texo/Troubleshooting#Prevent.2Fhandle_SQL_reserved_words_in_db_schema_names

gr. Martin

On 05/15/2012 12:23 PM, Olaf Burdziakowski wrote:
> Thank you Martin, it is working properly. (I found all path except the Column under Basic before).
> I solved in the same way problems for elements with restricted SQL names: "to" changed to "_to". Is is preferred way?


--

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@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Previous Topic:[EMF XML] : NPE on saving with OPTION_USE_CACHED_LOOKUP_TABLE and OPTION_EXTENDED_META_DATA option
Next Topic:UML operations are not accessible in uml.ecore
Goto Forum:
  


Current Time: Thu Mar 28 10:33:30 GMT 2024

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

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

Back to the top