|
Re: Texo: list of annoying details [message #873103 is a reply to message #873099] |
Thu, 17 May 2012 13:53 |
Martin Taal 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 #873153 is a reply to message #873129] |
Thu, 17 May 2012 15:48 |
Martin Taal 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 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.03874 seconds