Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] Annotation for array of TEXT EString values
[Texo] Annotation for array of TEXT EString values [message #1707732] Tue, 08 September 2015 22:29 Go to next message
Mike Cooper is currently offline Mike CooperFriend
Messages: 60
Registered: February 2011
Member
I have an EAttribute which is an array of EString values. I need each value in the db to be TEXT since the length of the string values is often > 255 chars.

I added an annotation Annotated EClass - Annotated EAttribute - ORM Annotation - Basic - Column (set Column Definition to "TEXT"). When I have Texo generate code it creates:


	
@ElementCollection()
	@Column(name = "T_element")
	@Column(columnDefinition = "TEXT")
	@CollectionTable(joinColumns = { @JoinColumn(name = "NotificationEvent_id") }, name = "NotificationEvent_Messages")
	@Basic()
	private List<String> messages = new ArrayList<String>();



I believe what Texo should generate is a single Column line as such:

@Column(name = "T_element", columnDefinition="TEXT")


Is this a bug or am I not annotating correctly?
Re: [Texo] Annotation for array of TEXT EString values [message #1707813 is a reply to message #1707732] Wed, 09 September 2015 13:50 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Mike,
Texo/ORMs assume that a list of values should be stored in a separate table.
So in this case you will get a table with a text column to store the list of values.

So it is not really a bug. If you want to serialize/persist a list<string> in a single column then you need to dive into
customer persisters I guess, this will be specific for the ORM you are using I guess.

gr. Martin

On 09-09-15 00:29, Mike Cooper wrote:
> I have an EAttribute which is an array of EString values. I need each value in the db to be TEXT since the length of
> the string values is often > 255 chars.
>
> I added an annotation Annotated EClass - Annotated EAttribute - ORM Annotation - Basic - Column (set Column Definition
> to "TEXT"). When I have Texo generate code it creates:
>
>
>
> @ElementCollection()
> @Column(name = "T_element")
> @Column(columnDefinition = "TEXT")
> @CollectionTable(joinColumns = { @JoinColumn(name = "NotificationEvent_id") }, name = "NotificationEvent_Messages")
> @Basic()
> private List<String> messages = new ArrayList<String>();
>
>
>
> I believe what Texo should generate is a single Column line as such:
>
>
> @Column(name = "T_element", columnDefinition="TEXT")
>
>
> Is this a bug or am I not annotating correctly?
>


--

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:[EEF] Default EEF model initialization
Next Topic:[EMFForms] Custom control replacement by type
Goto Forum:
  


Current Time: Tue Dec 01 18:44:55 GMT 2020

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

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

Back to the top