Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Texo] ignore not null syntax(Oracle problem with string 0 lenght)
[Texo] ignore not null syntax [message #876896] Fri, 25 May 2012 13:32 Go to next message
Olaf Burdziakowski is currently offline Olaf Burdziakowski
Messages: 46
Registered: April 2012
Member
In my model there is defined String attribute than must be always present but may be empty (empty string).
Problem occurs when Oracle database is connected. Oracle translate zero length string to null (not standard). Than generate an error during insert do database: null to not nulable column.
To make work around I defined column as nulable but ecore model still has this attribute as mandatory.
The problem is that Texo when save xml do not write the attribute to xml file (ignore model, use null value from database as more important. I even tried to make default value:
@Basic()
@Column(name = "xserviceOption", nullable = true)
private String serviceOption = "";

But still with the same result - attribute is not present in output xml.
How to solve this?
Re: [Texo] ignore not null syntax [message #877837 is a reply to message #876896] Sun, 27 May 2012 22:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Olaf,
I asked a question about this on the EMF forum. Based on the answer I get I will maybe change this in Texo...

gr. Martin

On 05/25/2012 03:32 PM, Olaf Burdziakowski wrote:
> In my model there is defined String attribute than must be always present but may be empty (empty string).
> Problem occurs when Oracle database is connected. Oracle translate zero length string to null (not standard). Than
> generate an error during insert do database: null to not nulable column.
> To make work around I defined column as nulable but ecore model still has this attribute as mandatory.
> The problem is that Texo when save xml do not write the attribute to xml file (ignore model, use null value from
> database as more important. I even tried to make default value:
> @Basic()
> @Column(name = "xserviceOption", nullable = true)
> private String serviceOption = "";
>
> But still with the same result - attribute is not present in output xml.
> How to solve 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] ignore not null syntax [message #877991 is a reply to message #877837] Mon, 28 May 2012 08:56 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5332
Registered: July 2009
Senior Member
Hi Olaf,
Can you enter a bugzilla feature request for this? To always serialize null required elements/attributes.

gr. Martin

On 05/28/2012 12:09 AM, Martin Taal wrote:
> Hi Olaf,
> I asked a question about this on the EMF forum. Based on the answer I get I will maybe change this in Texo...
>
> gr. Martin
>
> On 05/25/2012 03:32 PM, Olaf Burdziakowski wrote:
>> In my model there is defined String attribute than must be always present but may be empty (empty string).
>> Problem occurs when Oracle database is connected. Oracle translate zero length string to null (not standard). Than
>> generate an error during insert do database: null to not nulable column.
>> To make work around I defined column as nulable but ecore model still has this attribute as mandatory.
>> The problem is that Texo when save xml do not write the attribute to xml file (ignore model, use null value from
>> database as more important. I even tried to make default value:
>> @Basic()
>> @Column(name = "xserviceOption", nullable = true)
>> private String serviceOption = "";
>>
>> But still with the same result - attribute is not present in output xml.
>> How to solve 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
Previous Topic:[Texo] Problem with enforce unique names
Next Topic:[EcoreTools] Problem installing on 3.8
Goto Forum:
  


Current Time: Tue Sep 16 03:09:34 GMT 2014

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

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