Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Texo: list of annoying details
Texo: list of annoying details [message #873099] Thu, 17 May 2012 13:47 Go to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
I work for a while with Texo. I find it very useful but there are some annoying details. I do not know if these are bugs or "features", please clarify:

1.I set prefix to empty in my ecore model. (nsPrefix=""). Then I generate code (Generate JPA annotated model code). I got model new code with copy of my ecore model where the prefix is again default. I have to enter and clear it again.

2.Annotation model editor shows 'inverseJoinColumn' as 'joinColumn'. So such structure:

<joinTable name="DPL_creconfig_GroupType_creditingMeasure">
<joinColumn name="gr_id"/>
<inverseJoinColumn name="cm_id"/>
</joinTable>

Is shown as two joinColumns instead joinColumn and inverseJoinColumn

3.Texo generate such code:
@JoinColumns({ @JoinColumn(name = "condition") })
private VarConditionType condition = null;

The "condition" is restricted for hibernate and do not work. I wanted to annotated this as: "_condition":
<eClass href="cre_config.ecore#//VarInputType"/>
<annotatedEStructuralFeatures xsi:type="annotationsmodel:AnnotatedEReference">
<eReference href="cre_config.ecore#//VarInputType/condition"/>
<eReferenceAnnotations xsi:type="ormannotations:EReferenceORMAnnotation">
<joinColumn name="_condition"/>
</eReferenceAnnotations>
</annotatedEStructuralFeatures>
This do not works .... Still code has "condition" instead of "_condition"

4. Eclipse has a problem with recognizing updates of xsd model from external tools, (and refresh in Eclipse - F5): sometimes I have to restart Eclipse to force Texo regenerate code properly. Example: delete ecore model. Recreate ecore model. Genarate JPA annotated code. The code was generated without noticing annotationmodel file. Restart of Eclipse helps.
Re: Texo: list of annoying details [message #873103 is a reply to message #873099] Thu, 17 May 2012 13:53 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Olaf,
Comments inline.

gr. Martin

On 05/17/2012 03:47 PM, Olaf Burdziakowski wrote:
> I work for a while with Texo. I find it very useful but there are some annoying details. I do not know if these are bugs
> or "features", please clarify:
>
> 1.I set prefix to empty in my ecore model. (nsPrefix=""). Then I generate code (Generate JPA annotated model code). I
> got model new code with copy of my ecore model where the prefix is again default. I have to enter and clear it again.
MT>> Yes, the prefix is used to make names unique etc. Why do want it to be ""?

>
> 2.Annotation model editor shows 'inverseJoinColumn' as 'joinColumn'. So such structure:
>
> <joinTable name="DPL_creconfig_GroupType_creditingMeasure">
> <joinColumn name="gr_id"/>
> <inverseJoinColumn name="cm_id"/>
> </joinTable>
>
> Is shown as two joinColumns instead joinColumn and inverseJoinColumn
MT>> A bug, can you enter a bugzilla for it?

>
> 3.Texo generate such code:
> @JoinColumns({ @JoinColumn(name = "condition") })
> private VarConditionType condition = null;
>
> The "condition" is restricted for hibernate and do not work. I wanted to annotated this as: "_condition":
> <eClass href="cre_config.ecore#//VarInputType"/>
> <annotatedEStructuralFeatures xsi:type="annotationsmodel:AnnotatedEReference">
> <eReference href="cre_config.ecore#//VarInputType/condition"/>
> <eReferenceAnnotations xsi:type="ormannotations:EReferenceORMAnnotation">
> <joinColumn name="_condition"/>
> </eReferenceAnnotations>
> </annotatedEStructuralFeatures>
> This do not works .... Still code has "condition" instead of "_condition"
MT>> Can you enter a bugzilla for it (in the same one as the previous point is fine).
Note to get around reserved words in hibernate you can set a hibernate option:
http://wiki.eclipse.org/Texo/Troubleshooting#Prevent.2Fhandle_SQL_reserved_words_in_db_schema_names

>
> 4. Eclipse has a problem with recognizing updates of xsd model from external tools, (and refresh in Eclipse - F5):
> sometimes I have to restart Eclipse to force Texo regenerate code properly. Example: delete ecore model. Recreate ecore
> model. Genarate JPA annotated code. The code was generated without noticing annotationmodel file. Restart of Eclipse helps.
MT>> Hmm, so it is not that the xsd model changes are not detected, what you see is that the annotationsmodel is not
read/detected?



--

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: list of annoying details [message #873121 is a reply to message #873103] Thu, 17 May 2012 14:21 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
About 1:(nsPrefix="")
My xml files do not have (nsPrefix=""). I store it to database and later recreate database back to xml.
This files must have the same structure - no prefix (nsPrefix="").
I really need it and always after model/code recreateation have to clear it manually.
Re: Texo: list of annoying details [message #873124 is a reply to message #873121] Thu, 17 May 2012 14:28 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Ed,
Is it possible to serialize to XML using EMF without namespace prefixing of xml elements?
Setting the default name space somehow?

gr. Martin

On 05/17/2012 04:21 PM, Olaf Burdziakowski wrote:
> About 1:(nsPrefix="")
> My xml files do not have (nsPrefix=""). I store it to database and later recreate database back to xml.
> This files must have the same structure - no prefix (nsPrefix="").
> I really need it and always after model/code recreateation have to clear it manually.


--

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: list of annoying details [message #873129 is a reply to message #873124] Thu, 17 May 2012 14:50 Go to previous messageGo to next message
Olaf Burdziakowski is currently offline Olaf BurdziakowskiFriend
Messages: 46
Registered: April 2012
Member
Well, you tool is doing that Wink

When I read my xml I add namespace:(example_
sXml = sXml.replace("<list>", "<list xmlns=\""+sNamespace+"\">");
When I save xml I remove namespace:
String sNamespace = " xmlns=\""+FilepricedataModelPackage.NS_URI+"\"";
p_sXml = p_sXml.replace(sNamespace, "");

this is enough. So all I need before save is to have ecore.model with set nsPrefix="".
This works fine.
Re: Texo: list of annoying details [message #873153 is a reply to message #873129] Thu, 17 May 2012 15:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Ha ha, yes I know, that's why I asked the question to Ed the project lead of EMF (see the first line of my previous
post). He knows all the details of XML serialization.

But looking at your example, you don't even want the xmlns namespace attribute? So the prefix is not the problem, it is
the presence of the xmlns attribute?

gr. Martin

On 05/17/2012 04:50 PM, Olaf Burdziakowski wrote:
> Well, you tool is doing that ;)
>
> When I read my xml I add namespace:(example_
> sXml = sXml.replace("<list>", "<list xmlns=\""+sNamespace+"\">");
> When I save xml I remove namespace:
> String sNamespace = " xmlns=\""+FilepricedataModelPackage.NS_URI+"\"";
> p_sXml = p_sXml.replace(sNamespace, "");
>
> this is enough. So all I need before save is to have ecore.model with set nsPrefix="".
> This works fine.


--

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: list of annoying details [message #873169 is a reply to message #873153] Thu, 17 May 2012 16:06 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Martin,

If you have a schema with no target namespace, EMF generates suitable
annotations (extended meta data annotations) so that the serialization
will have no prefixes. The details are a bit tricky (including the
options in the generated resource factory) so best to look at what EMF
generates for a schema without a target namespace.


On 17/05/2012 5:48 PM, Martin Taal wrote:
> Ha ha, yes I know, that's why I asked the question to Ed the project
> lead of EMF (see the first line of my previous post). He knows all the
> details of XML serialization.
>
> But looking at your example, you don't even want the xmlns namespace
> attribute? So the prefix is not the problem, it is the presence of the
> xmlns attribute?
>
> gr. Martin
>
> On 05/17/2012 04:50 PM, Olaf Burdziakowski wrote:
>> Well, you tool is doing that ;)
>>
>> When I read my xml I add namespace:(example_
>> sXml = sXml.replace("<list>", "<list xmlns=\""+sNamespace+"\">");
>> When I save xml I remove namespace:
>> String sNamespace = " xmlns=\""+FilepricedataModelPackage.NS_URI+"\"";
>> p_sXml = p_sXml.replace(sNamespace, "");
>>
>> this is enough. So all I need before save is to have ecore.model with
>> set nsPrefix="".
>> This works fine.
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Texo] Hard-coded date time format ...
Next Topic:[TEXO] traverse object graph
Goto Forum:
  


Current Time: Thu Mar 28 20:24:41 GMT 2024

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

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

Back to the top