Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] : Transient annotation not working on EClass.
[Teneo] : Transient annotation not working on EClass. [message #80845] Tue, 24 April 2007 11:13 Go to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi,
im having a problem with the Transient annotation when set on an EClass. Im using an
annotations.xml file with the following entry:

<epackage namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
<eclass name="XSMeasure">
<transient/>
</eclass>
</epackage>

The ecore for this files looks like:

<eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="Code" lowerBound="1" eType="ecore:EClass
codelist.ecore#//Code"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="MeasureTypeDimension" lowerBound="1"
eType="#//MeasureTypeDimension"/>
</eClassifiers>

The class XSMeasure has no superclass and contains only two uni-directional many-to-one references
to other classes which are navigable only from XSMeasure.

I would expect XSMeasure not to be included in the hibernate mapping which Teneo generates but it
always appears on re-generation.

Other elements within the annotations.xml file are working as expected but never the Transient tag.

Is this the correct syntax Im using here ?

Any help is appreciated.

Duncan
Re: [Teneo] : Transient annotation not working on EClass. [message #80846 is a reply to message #80845] Tue, 24 April 2007 11:14 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Forgot to add, the class XSMeasure does not 'contain' the features it references.

Duncan

Duncan ALexander wrote:
> Hi,
> im having a problem with the Transient annotation when set on an
> EClass. Im using an annotations.xml file with the following entry:
>
> <epackage
> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
> <eclass name="XSMeasure">
> <transient/>
> </eclass>
> </epackage>
>
> The ecore for this files looks like:
>
> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
> <eStructuralFeatures xsi:type="ecore:EReference"
> name="MeasureTypeDimension" lowerBound="1"
> eType="#//MeasureTypeDimension"/>
> </eClassifiers>
>
> The class XSMeasure has no superclass and contains only two
> uni-directional many-to-one references to other classes which are
> navigable only from XSMeasure.
>
> I would expect XSMeasure not to be included in the hibernate mapping
> which Teneo generates but it always appears on re-generation.
>
> Other elements within the annotations.xml file are working as expected
> but never the Transient tag.
>
> Is this the correct syntax Im using here ?
>
> Any help is appreciated.
>
> Duncan
Re: [Teneo] : Transient annotation not working on EClass. [message #80934 is a reply to message #80846] Tue, 24 April 2007 16:09 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
I have tested this and it worked fine with me, the xml example I use:

<epackage namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">

<eclass name="Body">
<property name="theID">
<id/>
</property>
</eclass>

<eclass name="Head">
<transient/>
</eclass>

</epackage>

Which Teneo version are you on?

Btw, I have added the behavior that if an ereference references a transient eclass that then the
ereference is also set to transient. This will be in a new release.

gr. Martin

Duncan ALexander wrote:
> Forgot to add, the class XSMeasure does not 'contain' the features it
> references.
>
> Duncan
>
> Duncan ALexander wrote:
>> Hi,
>> im having a problem with the Transient annotation when set on an
>> EClass. Im using an annotations.xml file with the following entry:
>>
>> <epackage
>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>
>> <eclass name="XSMeasure">
>> <transient/>
>> </eclass>
>> </epackage>
>>
>> The ecore for this files looks like:
>>
>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>> <eStructuralFeatures xsi:type="ecore:EReference"
>> name="MeasureTypeDimension" lowerBound="1"
>> eType="#//MeasureTypeDimension"/>
>> </eClassifiers>
>>
>> The class XSMeasure has no superclass and contains only two
>> uni-directional many-to-one references to other classes which are
>> navigable only from XSMeasure.
>>
>> I would expect XSMeasure not to be included in the hibernate mapping
>> which Teneo generates but it always appears on re-generation.
>>
>> Other elements within the annotations.xml file are working as expected
>> but never the Transient tag.
>>
>> Is this the correct syntax Im using here ?
>>
>> Any help is appreciated.
>>
>> Duncan


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #80950 is a reply to message #80934] Tue, 24 April 2007 17:17 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5

Ive tried the transient on a few different classes now always with the same results. Im making sure
that the annotations.xml is being picked up correctly.

My assumption was that there was some issue with references but I understood that only bidirectional
references could prevent the transient class from not being persisted.

Duncan

Martin Taal wrote:
> Hi Duncan,
> I have tested this and it worked fine with me, the xml example I use:
>
> <epackage
> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>
>
> <eclass name="Body">
> <property name="theID">
> <id/>
> </property>
> </eclass>
>
> <eclass name="Head">
> <transient/>
> </eclass>
>
> </epackage>
>
> Which Teneo version are you on?
>
> Btw, I have added the behavior that if an ereference references a
> transient eclass that then the ereference is also set to transient. This
> will be in a new release.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Forgot to add, the class XSMeasure does not 'contain' the features it
>> references.
>>
>> Duncan
>>
>> Duncan ALexander wrote:
>>> Hi,
>>> im having a problem with the Transient annotation when set on an
>>> EClass. Im using an annotations.xml file with the following entry:
>>>
>>> <epackage
>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>
>>> <eclass name="XSMeasure">
>>> <transient/>
>>> </eclass>
>>> </epackage>
>>>
>>> The ecore for this files looks like:
>>>
>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>> name="MeasureTypeDimension" lowerBound="1"
>>> eType="#//MeasureTypeDimension"/>
>>> </eClassifiers>
>>>
>>> The class XSMeasure has no superclass and contains only two
>>> uni-directional many-to-one references to other classes which are
>>> navigable only from XSMeasure.
>>>
>>> I would expect XSMeasure not to be included in the hibernate mapping
>>> which Teneo generates but it always appears on re-generation.
>>>
>>> Other elements within the annotations.xml file are working as
>>> expected but never the Transient tag.
>>>
>>> Is this the correct syntax Im using here ?
>>>
>>> Any help is appreciated.
>>>
>>> Duncan
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #80995 is a reply to message #80950] Wed, 25 April 2007 07:17 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
Can you debug into the DefaultAnnotator class and then the processClass method? For your transient
eclass the aClass parameter should have a member called transient with a Transient object. If not
then I know something is wrong in the annotation parsing.

Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient annotation in the eannotation.
The test I mentioned below is on 0.8.0 for which I added also a transient annotation test with xml.

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>
> Ive tried the transient on a few different classes now always with the
> same results. Im making sure that the annotations.xml is being picked up
> correctly.
>
> My assumption was that there was some issue with references but I
> understood that only bidirectional
> references could prevent the transient class from not being persisted.
>
> Duncan
>
> Martin Taal wrote:
>> Hi Duncan,
>> I have tested this and it worked fine with me, the xml example I use:
>>
>> <epackage
>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>
>>
>> <eclass name="Body">
>> <property name="theID">
>> <id/>
>> </property>
>> </eclass>
>>
>> <eclass name="Head">
>> <transient/>
>> </eclass>
>>
>> </epackage>
>>
>> Which Teneo version are you on?
>>
>> Btw, I have added the behavior that if an ereference references a
>> transient eclass that then the ereference is also set to transient.
>> This will be in a new release.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Forgot to add, the class XSMeasure does not 'contain' the features it
>>> references.
>>>
>>> Duncan
>>>
>>> Duncan ALexander wrote:
>>>> Hi,
>>>> im having a problem with the Transient annotation when set on an
>>>> EClass. Im using an annotations.xml file with the following entry:
>>>>
>>>> <epackage
>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>
>>>> <eclass name="XSMeasure">
>>>> <transient/>
>>>> </eclass>
>>>> </epackage>
>>>>
>>>> The ecore for this files looks like:
>>>>
>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>> abstract="true">
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>> name="MeasureTypeDimension" lowerBound="1"
>>>> eType="#//MeasureTypeDimension"/>
>>>> </eClassifiers>
>>>>
>>>> The class XSMeasure has no superclass and contains only two
>>>> uni-directional many-to-one references to other classes which are
>>>> navigable only from XSMeasure.
>>>>
>>>> I would expect XSMeasure not to be included in the hibernate mapping
>>>> which Teneo generates but it always appears on re-generation.
>>>>
>>>> Other elements within the annotations.xml file are working as
>>>> expected but never the Transient tag.
>>>>
>>>> Is this the correct syntax Im using here ?
>>>>
>>>> Any help is appreciated.
>>>>
>>>> Duncan
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #81042 is a reply to message #80995] Wed, 25 April 2007 09:46 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
yes I already debugged into the processClass method and I can see that
their is a Transient object in the transient member variable for this class.
It would appear that it is picking it up ok from the annotations file but then somehow
it is getting lost.

Looking again.....I did notice in the processClass method at line 290 there is a check
to see if the class is Transient and it uses the getEAnnotation method on the annotated
class and uses the key "http://ejb.elver.org/Transient", but when I debug into this method
the eAnnotations list within the annotated class is empty and it drops straight out and
continues to process as normal.

regards

Duncan






Martin Taal wrote:
> Hi Duncan,
> Can you debug into the DefaultAnnotator class and then the processClass
> method? For your transient eclass the aClass parameter should have a
> member called transient with a Transient object. If not then I know
> something is wrong in the annotation parsing.
>
> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
> annotation in the eannotation. The test I mentioned below is on 0.8.0
> for which I added also a transient annotation test with xml.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>
>> Ive tried the transient on a few different classes now always with the
>> same results. Im making sure that the annotations.xml is being picked
>> up correctly.
>>
>> My assumption was that there was some issue with references but I
>> understood that only bidirectional
>> references could prevent the transient class from not being persisted.
>>
>> Duncan
>>
>> Martin Taal wrote:
>>> Hi Duncan,
>>> I have tested this and it worked fine with me, the xml example I use:
>>>
>>> <epackage
>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>
>>>
>>> <eclass name="Body">
>>> <property name="theID">
>>> <id/>
>>> </property>
>>> </eclass>
>>>
>>> <eclass name="Head">
>>> <transient/>
>>> </eclass>
>>>
>>> </epackage>
>>>
>>> Which Teneo version are you on?
>>>
>>> Btw, I have added the behavior that if an ereference references a
>>> transient eclass that then the ereference is also set to transient.
>>> This will be in a new release.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Forgot to add, the class XSMeasure does not 'contain' the features
>>>> it references.
>>>>
>>>> Duncan
>>>>
>>>> Duncan ALexander wrote:
>>>>> Hi,
>>>>> im having a problem with the Transient annotation when set on an
>>>>> EClass. Im using an annotations.xml file with the following entry:
>>>>>
>>>>> <epackage
>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>
>>>>> <eclass name="XSMeasure">
>>>>> <transient/>
>>>>> </eclass>
>>>>> </epackage>
>>>>>
>>>>> The ecore for this files looks like:
>>>>>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>> abstract="true">
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>> eType="#//MeasureTypeDimension"/>
>>>>> </eClassifiers>
>>>>>
>>>>> The class XSMeasure has no superclass and contains only two
>>>>> uni-directional many-to-one references to other classes which are
>>>>> navigable only from XSMeasure.
>>>>>
>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>> mapping which Teneo generates but it always appears on re-generation.
>>>>>
>>>>> Other elements within the annotations.xml file are working as
>>>>> expected but never the Transient tag.
>>>>>
>>>>> Is this the correct syntax Im using here ?
>>>>>
>>>>> Any help is appreciated.
>>>>>
>>>>> Duncan
>>>
>>>
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #81057 is a reply to message #81042] Wed, 25 April 2007 10:00 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
Is the entity member of the transient aClass set with an Entity instance? In case of a transient
eclass the defaultannotator should not set an entity instance in the aClass.

Can you also debug into the class HibernateMappingGenerator and then the method: processPAClass.
There the transient eclass should be ignored because it should not have the entity set.

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> yes I already debugged into the processClass method and I can see that
> their is a Transient object in the transient member variable for this
> class.
> It would appear that it is picking it up ok from the annotations file
> but then somehow
> it is getting lost.
>
> Looking again.....I did notice in the processClass method at line 290
> there is a check
> to see if the class is Transient and it uses the getEAnnotation method
> on the annotated
> class and uses the key "http://ejb.elver.org/Transient", but when I
> debug into this method
> the eAnnotations list within the annotated class is empty and it drops
> straight out and
> continues to process as normal.
>
> regards
>
> Duncan
>
>
>
>
>
>
> Martin Taal wrote:
>> Hi Duncan,
>> Can you debug into the DefaultAnnotator class and then the
>> processClass method? For your transient eclass the aClass parameter
>> should have a member called transient with a Transient object. If not
>> then I know something is wrong in the annotation parsing.
>>
>> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
>> annotation in the eannotation. The test I mentioned below is on 0.8.0
>> for which I added also a transient annotation test with xml.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi Martin,
>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>
>>> Ive tried the transient on a few different classes now always with
>>> the same results. Im making sure that the annotations.xml is being
>>> picked up correctly.
>>>
>>> My assumption was that there was some issue with references but I
>>> understood that only bidirectional
>>> references could prevent the transient class from not being persisted.
>>>
>>> Duncan
>>>
>>> Martin Taal wrote:
>>>> Hi Duncan,
>>>> I have tested this and it worked fine with me, the xml example I use:
>>>>
>>>> <epackage
>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>
>>>>
>>>> <eclass name="Body">
>>>> <property name="theID">
>>>> <id/>
>>>> </property>
>>>> </eclass>
>>>>
>>>> <eclass name="Head">
>>>> <transient/>
>>>> </eclass>
>>>>
>>>> </epackage>
>>>>
>>>> Which Teneo version are you on?
>>>>
>>>> Btw, I have added the behavior that if an ereference references a
>>>> transient eclass that then the ereference is also set to transient.
>>>> This will be in a new release.
>>>>
>>>> gr. Martin
>>>>
>>>> Duncan ALexander wrote:
>>>>> Forgot to add, the class XSMeasure does not 'contain' the features
>>>>> it references.
>>>>>
>>>>> Duncan
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Hi,
>>>>>> im having a problem with the Transient annotation when set on
>>>>>> an EClass. Im using an annotations.xml file with the following entry:
>>>>>>
>>>>>> <epackage
>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>
>>>>>> <eclass name="XSMeasure">
>>>>>> <transient/>
>>>>>> </eclass>
>>>>>> </epackage>
>>>>>>
>>>>>> The ecore for this files looks like:
>>>>>>
>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>> abstract="true">
>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>> </eClassifiers>
>>>>>>
>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>> uni-directional many-to-one references to other classes which are
>>>>>> navigable only from XSMeasure.
>>>>>>
>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>> mapping which Teneo generates but it always appears on re-generation.
>>>>>>
>>>>>> Other elements within the annotations.xml file are working as
>>>>>> expected but never the Transient tag.
>>>>>>
>>>>>> Is this the correct syntax Im using here ?
>>>>>>
>>>>>> Any help is appreciated.
>>>>>>
>>>>>> Duncan
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #81072 is a reply to message #81057] Wed, 25 April 2007 10:29 Go to previous messageGo to next message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
the entity (entity: org.eclipse.emf.teneo.annotations.pannotation.Entity ) member of the aClass is
null at the start of processClass but it does get set at line 312 therefore the
class does get processed once it reached HibernateMappingGenerator.processPAClass.


I did notice that if I add an eAnnotation to the ecore file (Source=teneo.jpa value=@Transient)
and debug into DefaultAnnotator.processClass then the annotated class does have
an entry in the eAnnotations list (whereas it doesnt when only using the annotations.xml file).

When processing hits line 290 and drops in the getEAnnotation method on the annotated class
it processes further into the method than before but again drops out because it cannot
find an annotation with the source="http://ejb.elver.org/Transient". The only annotation
in the list has source="teneo.jpa"

regards

Duncan


Martin Taal wrote:
> Hi Duncan,
> Is the entity member of the transient aClass set with an Entity
> instance? In case of a transient eclass the defaultannotator should not
> set an entity instance in the aClass.
>
> Can you also debug into the class HibernateMappingGenerator and then the
> method: processPAClass. There the transient eclass should be ignored
> because it should not have the entity set.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> yes I already debugged into the processClass method and I can see
>> that
>> their is a Transient object in the transient member variable for this
>> class.
>> It would appear that it is picking it up ok from the annotations file
>> but then somehow
>> it is getting lost.
>>
>> Looking again.....I did notice in the processClass method at line 290
>> there is a check
>> to see if the class is Transient and it uses the getEAnnotation method
>> on the annotated
>> class and uses the key "http://ejb.elver.org/Transient", but when I
>> debug into this method
>> the eAnnotations list within the annotated class is empty and it drops
>> straight out and
>> continues to process as normal.
>>
>> regards
>>
>> Duncan
>>
>>
>>
>>
>>
>>
>> Martin Taal wrote:
>>> Hi Duncan,
>>> Can you debug into the DefaultAnnotator class and then the
>>> processClass method? For your transient eclass the aClass parameter
>>> should have a member called transient with a Transient object. If not
>>> then I know something is wrong in the annotation parsing.
>>>
>>> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
>>> annotation in the eannotation. The test I mentioned below is on 0.8.0
>>> for which I added also a transient annotation test with xml.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Hi Martin,
>>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>>
>>>> Ive tried the transient on a few different classes now always with
>>>> the same results. Im making sure that the annotations.xml is being
>>>> picked up correctly.
>>>>
>>>> My assumption was that there was some issue with references but I
>>>> understood that only bidirectional
>>>> references could prevent the transient class from not being persisted.
>>>>
>>>> Duncan
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Duncan,
>>>>> I have tested this and it worked fine with me, the xml example I use:
>>>>>
>>>>> <epackage
>>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>>
>>>>>
>>>>> <eclass name="Body">
>>>>> <property name="theID">
>>>>> <id/>
>>>>> </property>
>>>>> </eclass>
>>>>>
>>>>> <eclass name="Head">
>>>>> <transient/>
>>>>> </eclass>
>>>>>
>>>>> </epackage>
>>>>>
>>>>> Which Teneo version are you on?
>>>>>
>>>>> Btw, I have added the behavior that if an ereference references a
>>>>> transient eclass that then the ereference is also set to transient.
>>>>> This will be in a new release.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Forgot to add, the class XSMeasure does not 'contain' the features
>>>>>> it references.
>>>>>>
>>>>>> Duncan
>>>>>>
>>>>>> Duncan ALexander wrote:
>>>>>>> Hi,
>>>>>>> im having a problem with the Transient annotation when set on
>>>>>>> an EClass. Im using an annotations.xml file with the following
>>>>>>> entry:
>>>>>>>
>>>>>>> <epackage
>>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>>
>>>>>>> <eclass name="XSMeasure">
>>>>>>> <transient/>
>>>>>>> </eclass>
>>>>>>> </epackage>
>>>>>>>
>>>>>>> The ecore for this files looks like:
>>>>>>>
>>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>>> abstract="true">
>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>>> </eClassifiers>
>>>>>>>
>>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>>> uni-directional many-to-one references to other classes which are
>>>>>>> navigable only from XSMeasure.
>>>>>>>
>>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>>> mapping which Teneo generates but it always appears on
>>>>>>> re-generation.
>>>>>>>
>>>>>>> Other elements within the annotations.xml file are working as
>>>>>>> expected but never the Transient tag.
>>>>>>>
>>>>>>> Is this the correct syntax Im using here ?
>>>>>>>
>>>>>>> Any help is appreciated.
>>>>>>>
>>>>>>> Duncan
>>>>>
>>>>>
>>>
>>>
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #81087 is a reply to message #81072] Wed, 25 April 2007 11:52 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
The xml is not translated into an eannotation but directly into the Transient instance being set in
the aClass.
There is a method call to: isMappableAnnotatedClass in the processAClass, if the aClass has
getTransient() != null then isMappableAnnotatedClass should return false, and no entity should be set.

Are you on the latest 0.7.5 release?

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> the entity (entity:
> org.eclipse.emf.teneo.annotations.pannotation.Entity ) member of the
> aClass is null at the start of processClass but it does get set at line
> 312 therefore the
> class does get processed once it reached
> HibernateMappingGenerator.processPAClass.
>
>
> I did notice that if I add an eAnnotation to the ecore file
> (Source=teneo.jpa value=@Transient)
> and debug into DefaultAnnotator.processClass then the annotated class
> does have
> an entry in the eAnnotations list (whereas it doesnt when only using the
> annotations.xml file).
>
> When processing hits line 290 and drops in the getEAnnotation method on
> the annotated class
> it processes further into the method than before but again drops out
> because it cannot
> find an annotation with the source="http://ejb.elver.org/Transient". The
> only annotation
> in the list has source="teneo.jpa"
>
> regards
>
> Duncan
>
>
> Martin Taal wrote:
>> Hi Duncan,
>> Is the entity member of the transient aClass set with an Entity
>> instance? In case of a transient eclass the defaultannotator should
>> not set an entity instance in the aClass.
>>
>> Can you also debug into the class HibernateMappingGenerator and then
>> the method: processPAClass. There the transient eclass should be
>> ignored because it should not have the entity set.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi Martin,
>>> yes I already debugged into the processClass method and I can see
>>> that
>>> their is a Transient object in the transient member variable for this
>>> class.
>>> It would appear that it is picking it up ok from the annotations file
>>> but then somehow
>>> it is getting lost.
>>>
>>> Looking again.....I did notice in the processClass method at line 290
>>> there is a check
>>> to see if the class is Transient and it uses the getEAnnotation
>>> method on the annotated
>>> class and uses the key "http://ejb.elver.org/Transient", but when I
>>> debug into this method
>>> the eAnnotations list within the annotated class is empty and it
>>> drops straight out and
>>> continues to process as normal.
>>>
>>> regards
>>>
>>> Duncan
>>>
>>>
>>>
>>>
>>>
>>>
>>> Martin Taal wrote:
>>>> Hi Duncan,
>>>> Can you debug into the DefaultAnnotator class and then the
>>>> processClass method? For your transient eclass the aClass parameter
>>>> should have a member called transient with a Transient object. If
>>>> not then I know something is wrong in the annotation parsing.
>>>>
>>>> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
>>>> annotation in the eannotation. The test I mentioned below is on
>>>> 0.8.0 for which I added also a transient annotation test with xml.
>>>>
>>>> gr. Martin
>>>>
>>>> Duncan ALexander wrote:
>>>>> Hi Martin,
>>>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>>>
>>>>> Ive tried the transient on a few different classes now always with
>>>>> the same results. Im making sure that the annotations.xml is being
>>>>> picked up correctly.
>>>>>
>>>>> My assumption was that there was some issue with references but I
>>>>> understood that only bidirectional
>>>>> references could prevent the transient class from not being persisted.
>>>>>
>>>>> Duncan
>>>>>
>>>>> Martin Taal wrote:
>>>>>> Hi Duncan,
>>>>>> I have tested this and it worked fine with me, the xml example I use:
>>>>>>
>>>>>> <epackage
>>>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>>>
>>>>>>
>>>>>> <eclass name="Body">
>>>>>> <property name="theID">
>>>>>> <id/>
>>>>>> </property>
>>>>>> </eclass>
>>>>>>
>>>>>> <eclass name="Head">
>>>>>> <transient/>
>>>>>> </eclass>
>>>>>>
>>>>>> </epackage>
>>>>>>
>>>>>> Which Teneo version are you on?
>>>>>>
>>>>>> Btw, I have added the behavior that if an ereference references a
>>>>>> transient eclass that then the ereference is also set to
>>>>>> transient. This will be in a new release.
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Duncan ALexander wrote:
>>>>>>> Forgot to add, the class XSMeasure does not 'contain' the
>>>>>>> features it references.
>>>>>>>
>>>>>>> Duncan
>>>>>>>
>>>>>>> Duncan ALexander wrote:
>>>>>>>> Hi,
>>>>>>>> im having a problem with the Transient annotation when set on
>>>>>>>> an EClass. Im using an annotations.xml file with the following
>>>>>>>> entry:
>>>>>>>>
>>>>>>>> <epackage
>>>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>>>
>>>>>>>> <eclass name="XSMeasure">
>>>>>>>> <transient/>
>>>>>>>> </eclass>
>>>>>>>> </epackage>
>>>>>>>>
>>>>>>>> The ecore for this files looks like:
>>>>>>>>
>>>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>>>> abstract="true">
>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>>>> </eClassifiers>
>>>>>>>>
>>>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>>>> uni-directional many-to-one references to other classes which
>>>>>>>> are navigable only from XSMeasure.
>>>>>>>>
>>>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>>>> mapping which Teneo generates but it always appears on
>>>>>>>> re-generation.
>>>>>>>>
>>>>>>>> Other elements within the annotations.xml file are working as
>>>>>>>> expected but never the Transient tag.
>>>>>>>>
>>>>>>>> Is this the correct syntax Im using here ?
>>>>>>>>
>>>>>>>> Any help is appreciated.
>>>>>>>>
>>>>>>>> Duncan
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #81161 is a reply to message #81087] Wed, 25 April 2007 14:14 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
that was it. I updated to the new build of 0.75 (Apr22) and it worked.
I can see the updated code in the processClass method which now deals with
Transient.

again, Many thanks.

Duncan

Martin Taal wrote:
> Hi Duncan,
> The xml is not translated into an eannotation but directly into the
> Transient instance being set in the aClass.
> There is a method call to: isMappableAnnotatedClass in the
> processAClass, if the aClass has getTransient() != null then
> isMappableAnnotatedClass should return false, and no entity should be set.
>
> Are you on the latest 0.7.5 release?
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> the entity (entity:
>> org.eclipse.emf.teneo.annotations.pannotation.Entity ) member of the
>> aClass is null at the start of processClass but it does get set at
>> line 312 therefore the
>> class does get processed once it reached
>> HibernateMappingGenerator.processPAClass.
>>
>>
>> I did notice that if I add an eAnnotation to the ecore file
>> (Source=teneo.jpa value=@Transient)
>> and debug into DefaultAnnotator.processClass then the annotated class
>> does have
>> an entry in the eAnnotations list (whereas it doesnt when only using
>> the annotations.xml file).
>>
>> When processing hits line 290 and drops in the getEAnnotation method
>> on the annotated class
>> it processes further into the method than before but again drops out
>> because it cannot
>> find an annotation with the source="http://ejb.elver.org/Transient".
>> The only annotation
>> in the list has source="teneo.jpa"
>>
>> regards
>>
>> Duncan
>>
>>
>> Martin Taal wrote:
>>> Hi Duncan,
>>> Is the entity member of the transient aClass set with an Entity
>>> instance? In case of a transient eclass the defaultannotator should
>>> not set an entity instance in the aClass.
>>>
>>> Can you also debug into the class HibernateMappingGenerator and then
>>> the method: processPAClass. There the transient eclass should be
>>> ignored because it should not have the entity set.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Hi Martin,
>>>> yes I already debugged into the processClass method and I can
>>>> see that
>>>> their is a Transient object in the transient member variable for
>>>> this class.
>>>> It would appear that it is picking it up ok from the annotations
>>>> file but then somehow
>>>> it is getting lost.
>>>>
>>>> Looking again.....I did notice in the processClass method at line
>>>> 290 there is a check
>>>> to see if the class is Transient and it uses the getEAnnotation
>>>> method on the annotated
>>>> class and uses the key "http://ejb.elver.org/Transient", but when I
>>>> debug into this method
>>>> the eAnnotations list within the annotated class is empty and it
>>>> drops straight out and
>>>> continues to process as normal.
>>>>
>>>> regards
>>>>
>>>> Duncan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Duncan,
>>>>> Can you debug into the DefaultAnnotator class and then the
>>>>> processClass method? For your transient eclass the aClass parameter
>>>>> should have a member called transient with a Transient object. If
>>>>> not then I know something is wrong in the annotation parsing.
>>>>>
>>>>> Btw, Teneo 0.7.5 has a test for transient but it uses the
>>>>> @Transient annotation in the eannotation. The test I mentioned
>>>>> below is on 0.8.0 for which I added also a transient annotation
>>>>> test with xml.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Hi Martin,
>>>>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>>>>
>>>>>> Ive tried the transient on a few different classes now always with
>>>>>> the same results. Im making sure that the annotations.xml is being
>>>>>> picked up correctly.
>>>>>>
>>>>>> My assumption was that there was some issue with references but I
>>>>>> understood that only bidirectional
>>>>>> references could prevent the transient class from not being
>>>>>> persisted.
>>>>>>
>>>>>> Duncan
>>>>>>
>>>>>> Martin Taal wrote:
>>>>>>> Hi Duncan,
>>>>>>> I have tested this and it worked fine with me, the xml example I
>>>>>>> use:
>>>>>>>
>>>>>>> <epackage
>>>>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>>>>
>>>>>>>
>>>>>>> <eclass name="Body">
>>>>>>> <property name="theID">
>>>>>>> <id/>
>>>>>>> </property>
>>>>>>> </eclass>
>>>>>>>
>>>>>>> <eclass name="Head">
>>>>>>> <transient/>
>>>>>>> </eclass>
>>>>>>>
>>>>>>> </epackage>
>>>>>>>
>>>>>>> Which Teneo version are you on?
>>>>>>>
>>>>>>> Btw, I have added the behavior that if an ereference references a
>>>>>>> transient eclass that then the ereference is also set to
>>>>>>> transient. This will be in a new release.
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> Duncan ALexander wrote:
>>>>>>>> Forgot to add, the class XSMeasure does not 'contain' the
>>>>>>>> features it references.
>>>>>>>>
>>>>>>>> Duncan
>>>>>>>>
>>>>>>>> Duncan ALexander wrote:
>>>>>>>>> Hi,
>>>>>>>>> im having a problem with the Transient annotation when set
>>>>>>>>> on an EClass. Im using an annotations.xml file with the
>>>>>>>>> following entry:
>>>>>>>>>
>>>>>>>>> <epackage
>>>>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>>>>
>>>>>>>>> <eclass name="XSMeasure">
>>>>>>>>> <transient/>
>>>>>>>>> </eclass>
>>>>>>>>> </epackage>
>>>>>>>>>
>>>>>>>>> The ecore for this files looks like:
>>>>>>>>>
>>>>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>>>>> abstract="true">
>>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>>>> name="Code" lowerBound="1" eType="ecore:EClass
>>>>>>>>> codelist.ecore#//Code"/>
>>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>>>>> </eClassifiers>
>>>>>>>>>
>>>>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>>>>> uni-directional many-to-one references to other classes which
>>>>>>>>> are navigable only from XSMeasure.
>>>>>>>>>
>>>>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>>>>> mapping which Teneo generates but it always appears on
>>>>>>>>> re-generation.
>>>>>>>>>
>>>>>>>>> Other elements within the annotations.xml file are working as
>>>>>>>>> expected but never the Transient tag.
>>>>>>>>>
>>>>>>>>> Is this the correct syntax Im using here ?
>>>>>>>>>
>>>>>>>>> Any help is appreciated.
>>>>>>>>>
>>>>>>>>> Duncan
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #604977 is a reply to message #80845] Tue, 24 April 2007 11:14 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Forgot to add, the class XSMeasure does not 'contain' the features it references.

Duncan

Duncan ALexander wrote:
> Hi,
> im having a problem with the Transient annotation when set on an
> EClass. Im using an annotations.xml file with the following entry:
>
> <epackage
> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
> <eclass name="XSMeasure">
> <transient/>
> </eclass>
> </epackage>
>
> The ecore for this files looks like:
>
> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
> <eStructuralFeatures xsi:type="ecore:EReference"
> name="MeasureTypeDimension" lowerBound="1"
> eType="#//MeasureTypeDimension"/>
> </eClassifiers>
>
> The class XSMeasure has no superclass and contains only two
> uni-directional many-to-one references to other classes which are
> navigable only from XSMeasure.
>
> I would expect XSMeasure not to be included in the hibernate mapping
> which Teneo generates but it always appears on re-generation.
>
> Other elements within the annotations.xml file are working as expected
> but never the Transient tag.
>
> Is this the correct syntax Im using here ?
>
> Any help is appreciated.
>
> Duncan
Re: [Teneo] : Transient annotation not working on EClass. [message #604998 is a reply to message #80846] Tue, 24 April 2007 16:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
I have tested this and it worked fine with me, the xml example I use:

<epackage namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">

<eclass name="Body">
<property name="theID">
<id/>
</property>
</eclass>

<eclass name="Head">
<transient/>
</eclass>

</epackage>

Which Teneo version are you on?

Btw, I have added the behavior that if an ereference references a transient eclass that then the
ereference is also set to transient. This will be in a new release.

gr. Martin

Duncan ALexander wrote:
> Forgot to add, the class XSMeasure does not 'contain' the features it
> references.
>
> Duncan
>
> Duncan ALexander wrote:
>> Hi,
>> im having a problem with the Transient annotation when set on an
>> EClass. Im using an annotations.xml file with the following entry:
>>
>> <epackage
>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>
>> <eclass name="XSMeasure">
>> <transient/>
>> </eclass>
>> </epackage>
>>
>> The ecore for this files looks like:
>>
>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>> <eStructuralFeatures xsi:type="ecore:EReference"
>> name="MeasureTypeDimension" lowerBound="1"
>> eType="#//MeasureTypeDimension"/>
>> </eClassifiers>
>>
>> The class XSMeasure has no superclass and contains only two
>> uni-directional many-to-one references to other classes which are
>> navigable only from XSMeasure.
>>
>> I would expect XSMeasure not to be included in the hibernate mapping
>> which Teneo generates but it always appears on re-generation.
>>
>> Other elements within the annotations.xml file are working as expected
>> but never the Transient tag.
>>
>> Is this the correct syntax Im using here ?
>>
>> Any help is appreciated.
>>
>> Duncan


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #605003 is a reply to message #80934] Tue, 24 April 2007 17:17 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5

Ive tried the transient on a few different classes now always with the same results. Im making sure
that the annotations.xml is being picked up correctly.

My assumption was that there was some issue with references but I understood that only bidirectional
references could prevent the transient class from not being persisted.

Duncan

Martin Taal wrote:
> Hi Duncan,
> I have tested this and it worked fine with me, the xml example I use:
>
> <epackage
> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>
>
> <eclass name="Body">
> <property name="theID">
> <id/>
> </property>
> </eclass>
>
> <eclass name="Head">
> <transient/>
> </eclass>
>
> </epackage>
>
> Which Teneo version are you on?
>
> Btw, I have added the behavior that if an ereference references a
> transient eclass that then the ereference is also set to transient. This
> will be in a new release.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Forgot to add, the class XSMeasure does not 'contain' the features it
>> references.
>>
>> Duncan
>>
>> Duncan ALexander wrote:
>>> Hi,
>>> im having a problem with the Transient annotation when set on an
>>> EClass. Im using an annotations.xml file with the following entry:
>>>
>>> <epackage
>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>
>>> <eclass name="XSMeasure">
>>> <transient/>
>>> </eclass>
>>> </epackage>
>>>
>>> The ecore for this files looks like:
>>>
>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure" abstract="true">
>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>> name="MeasureTypeDimension" lowerBound="1"
>>> eType="#//MeasureTypeDimension"/>
>>> </eClassifiers>
>>>
>>> The class XSMeasure has no superclass and contains only two
>>> uni-directional many-to-one references to other classes which are
>>> navigable only from XSMeasure.
>>>
>>> I would expect XSMeasure not to be included in the hibernate mapping
>>> which Teneo generates but it always appears on re-generation.
>>>
>>> Other elements within the annotations.xml file are working as
>>> expected but never the Transient tag.
>>>
>>> Is this the correct syntax Im using here ?
>>>
>>> Any help is appreciated.
>>>
>>> Duncan
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #605013 is a reply to message #80950] Wed, 25 April 2007 07:17 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
Can you debug into the DefaultAnnotator class and then the processClass method? For your transient
eclass the aClass parameter should have a member called transient with a Transient object. If not
then I know something is wrong in the annotation parsing.

Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient annotation in the eannotation.
The test I mentioned below is on 0.8.0 for which I added also a transient annotation test with xml.

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>
> Ive tried the transient on a few different classes now always with the
> same results. Im making sure that the annotations.xml is being picked up
> correctly.
>
> My assumption was that there was some issue with references but I
> understood that only bidirectional
> references could prevent the transient class from not being persisted.
>
> Duncan
>
> Martin Taal wrote:
>> Hi Duncan,
>> I have tested this and it worked fine with me, the xml example I use:
>>
>> <epackage
>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>
>>
>> <eclass name="Body">
>> <property name="theID">
>> <id/>
>> </property>
>> </eclass>
>>
>> <eclass name="Head">
>> <transient/>
>> </eclass>
>>
>> </epackage>
>>
>> Which Teneo version are you on?
>>
>> Btw, I have added the behavior that if an ereference references a
>> transient eclass that then the ereference is also set to transient.
>> This will be in a new release.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Forgot to add, the class XSMeasure does not 'contain' the features it
>>> references.
>>>
>>> Duncan
>>>
>>> Duncan ALexander wrote:
>>>> Hi,
>>>> im having a problem with the Transient annotation when set on an
>>>> EClass. Im using an annotations.xml file with the following entry:
>>>>
>>>> <epackage
>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>
>>>> <eclass name="XSMeasure">
>>>> <transient/>
>>>> </eclass>
>>>> </epackage>
>>>>
>>>> The ecore for this files looks like:
>>>>
>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>> abstract="true">
>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>> name="MeasureTypeDimension" lowerBound="1"
>>>> eType="#//MeasureTypeDimension"/>
>>>> </eClassifiers>
>>>>
>>>> The class XSMeasure has no superclass and contains only two
>>>> uni-directional many-to-one references to other classes which are
>>>> navigable only from XSMeasure.
>>>>
>>>> I would expect XSMeasure not to be included in the hibernate mapping
>>>> which Teneo generates but it always appears on re-generation.
>>>>
>>>> Other elements within the annotations.xml file are working as
>>>> expected but never the Transient tag.
>>>>
>>>> Is this the correct syntax Im using here ?
>>>>
>>>> Any help is appreciated.
>>>>
>>>> Duncan
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #605025 is a reply to message #80995] Wed, 25 April 2007 09:46 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
yes I already debugged into the processClass method and I can see that
their is a Transient object in the transient member variable for this class.
It would appear that it is picking it up ok from the annotations file but then somehow
it is getting lost.

Looking again.....I did notice in the processClass method at line 290 there is a check
to see if the class is Transient and it uses the getEAnnotation method on the annotated
class and uses the key "http://ejb.elver.org/Transient", but when I debug into this method
the eAnnotations list within the annotated class is empty and it drops straight out and
continues to process as normal.

regards

Duncan






Martin Taal wrote:
> Hi Duncan,
> Can you debug into the DefaultAnnotator class and then the processClass
> method? For your transient eclass the aClass parameter should have a
> member called transient with a Transient object. If not then I know
> something is wrong in the annotation parsing.
>
> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
> annotation in the eannotation. The test I mentioned below is on 0.8.0
> for which I added also a transient annotation test with xml.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>
>> Ive tried the transient on a few different classes now always with the
>> same results. Im making sure that the annotations.xml is being picked
>> up correctly.
>>
>> My assumption was that there was some issue with references but I
>> understood that only bidirectional
>> references could prevent the transient class from not being persisted.
>>
>> Duncan
>>
>> Martin Taal wrote:
>>> Hi Duncan,
>>> I have tested this and it worked fine with me, the xml example I use:
>>>
>>> <epackage
>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>
>>>
>>> <eclass name="Body">
>>> <property name="theID">
>>> <id/>
>>> </property>
>>> </eclass>
>>>
>>> <eclass name="Head">
>>> <transient/>
>>> </eclass>
>>>
>>> </epackage>
>>>
>>> Which Teneo version are you on?
>>>
>>> Btw, I have added the behavior that if an ereference references a
>>> transient eclass that then the ereference is also set to transient.
>>> This will be in a new release.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Forgot to add, the class XSMeasure does not 'contain' the features
>>>> it references.
>>>>
>>>> Duncan
>>>>
>>>> Duncan ALexander wrote:
>>>>> Hi,
>>>>> im having a problem with the Transient annotation when set on an
>>>>> EClass. Im using an annotations.xml file with the following entry:
>>>>>
>>>>> <epackage
>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>
>>>>> <eclass name="XSMeasure">
>>>>> <transient/>
>>>>> </eclass>
>>>>> </epackage>
>>>>>
>>>>> The ecore for this files looks like:
>>>>>
>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>> abstract="true">
>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>> eType="#//MeasureTypeDimension"/>
>>>>> </eClassifiers>
>>>>>
>>>>> The class XSMeasure has no superclass and contains only two
>>>>> uni-directional many-to-one references to other classes which are
>>>>> navigable only from XSMeasure.
>>>>>
>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>> mapping which Teneo generates but it always appears on re-generation.
>>>>>
>>>>> Other elements within the annotations.xml file are working as
>>>>> expected but never the Transient tag.
>>>>>
>>>>> Is this the correct syntax Im using here ?
>>>>>
>>>>> Any help is appreciated.
>>>>>
>>>>> Duncan
>>>
>>>
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #605029 is a reply to message #81042] Wed, 25 April 2007 10:00 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
Is the entity member of the transient aClass set with an Entity instance? In case of a transient
eclass the defaultannotator should not set an entity instance in the aClass.

Can you also debug into the class HibernateMappingGenerator and then the method: processPAClass.
There the transient eclass should be ignored because it should not have the entity set.

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> yes I already debugged into the processClass method and I can see that
> their is a Transient object in the transient member variable for this
> class.
> It would appear that it is picking it up ok from the annotations file
> but then somehow
> it is getting lost.
>
> Looking again.....I did notice in the processClass method at line 290
> there is a check
> to see if the class is Transient and it uses the getEAnnotation method
> on the annotated
> class and uses the key "http://ejb.elver.org/Transient", but when I
> debug into this method
> the eAnnotations list within the annotated class is empty and it drops
> straight out and
> continues to process as normal.
>
> regards
>
> Duncan
>
>
>
>
>
>
> Martin Taal wrote:
>> Hi Duncan,
>> Can you debug into the DefaultAnnotator class and then the
>> processClass method? For your transient eclass the aClass parameter
>> should have a member called transient with a Transient object. If not
>> then I know something is wrong in the annotation parsing.
>>
>> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
>> annotation in the eannotation. The test I mentioned below is on 0.8.0
>> for which I added also a transient annotation test with xml.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi Martin,
>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>
>>> Ive tried the transient on a few different classes now always with
>>> the same results. Im making sure that the annotations.xml is being
>>> picked up correctly.
>>>
>>> My assumption was that there was some issue with references but I
>>> understood that only bidirectional
>>> references could prevent the transient class from not being persisted.
>>>
>>> Duncan
>>>
>>> Martin Taal wrote:
>>>> Hi Duncan,
>>>> I have tested this and it worked fine with me, the xml example I use:
>>>>
>>>> <epackage
>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>
>>>>
>>>> <eclass name="Body">
>>>> <property name="theID">
>>>> <id/>
>>>> </property>
>>>> </eclass>
>>>>
>>>> <eclass name="Head">
>>>> <transient/>
>>>> </eclass>
>>>>
>>>> </epackage>
>>>>
>>>> Which Teneo version are you on?
>>>>
>>>> Btw, I have added the behavior that if an ereference references a
>>>> transient eclass that then the ereference is also set to transient.
>>>> This will be in a new release.
>>>>
>>>> gr. Martin
>>>>
>>>> Duncan ALexander wrote:
>>>>> Forgot to add, the class XSMeasure does not 'contain' the features
>>>>> it references.
>>>>>
>>>>> Duncan
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Hi,
>>>>>> im having a problem with the Transient annotation when set on
>>>>>> an EClass. Im using an annotations.xml file with the following entry:
>>>>>>
>>>>>> <epackage
>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>
>>>>>> <eclass name="XSMeasure">
>>>>>> <transient/>
>>>>>> </eclass>
>>>>>> </epackage>
>>>>>>
>>>>>> The ecore for this files looks like:
>>>>>>
>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>> abstract="true">
>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>> </eClassifiers>
>>>>>>
>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>> uni-directional many-to-one references to other classes which are
>>>>>> navigable only from XSMeasure.
>>>>>>
>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>> mapping which Teneo generates but it always appears on re-generation.
>>>>>>
>>>>>> Other elements within the annotations.xml file are working as
>>>>>> expected but never the Transient tag.
>>>>>>
>>>>>> Is this the correct syntax Im using here ?
>>>>>>
>>>>>> Any help is appreciated.
>>>>>>
>>>>>> Duncan
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #605032 is a reply to message #81057] Wed, 25 April 2007 10:29 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
the entity (entity: org.eclipse.emf.teneo.annotations.pannotation.Entity ) member of the aClass is
null at the start of processClass but it does get set at line 312 therefore the
class does get processed once it reached HibernateMappingGenerator.processPAClass.


I did notice that if I add an eAnnotation to the ecore file (Source=teneo.jpa value=@Transient)
and debug into DefaultAnnotator.processClass then the annotated class does have
an entry in the eAnnotations list (whereas it doesnt when only using the annotations.xml file).

When processing hits line 290 and drops in the getEAnnotation method on the annotated class
it processes further into the method than before but again drops out because it cannot
find an annotation with the source="http://ejb.elver.org/Transient". The only annotation
in the list has source="teneo.jpa"

regards

Duncan


Martin Taal wrote:
> Hi Duncan,
> Is the entity member of the transient aClass set with an Entity
> instance? In case of a transient eclass the defaultannotator should not
> set an entity instance in the aClass.
>
> Can you also debug into the class HibernateMappingGenerator and then the
> method: processPAClass. There the transient eclass should be ignored
> because it should not have the entity set.
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> yes I already debugged into the processClass method and I can see
>> that
>> their is a Transient object in the transient member variable for this
>> class.
>> It would appear that it is picking it up ok from the annotations file
>> but then somehow
>> it is getting lost.
>>
>> Looking again.....I did notice in the processClass method at line 290
>> there is a check
>> to see if the class is Transient and it uses the getEAnnotation method
>> on the annotated
>> class and uses the key "http://ejb.elver.org/Transient", but when I
>> debug into this method
>> the eAnnotations list within the annotated class is empty and it drops
>> straight out and
>> continues to process as normal.
>>
>> regards
>>
>> Duncan
>>
>>
>>
>>
>>
>>
>> Martin Taal wrote:
>>> Hi Duncan,
>>> Can you debug into the DefaultAnnotator class and then the
>>> processClass method? For your transient eclass the aClass parameter
>>> should have a member called transient with a Transient object. If not
>>> then I know something is wrong in the annotation parsing.
>>>
>>> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
>>> annotation in the eannotation. The test I mentioned below is on 0.8.0
>>> for which I added also a transient annotation test with xml.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Hi Martin,
>>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>>
>>>> Ive tried the transient on a few different classes now always with
>>>> the same results. Im making sure that the annotations.xml is being
>>>> picked up correctly.
>>>>
>>>> My assumption was that there was some issue with references but I
>>>> understood that only bidirectional
>>>> references could prevent the transient class from not being persisted.
>>>>
>>>> Duncan
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Duncan,
>>>>> I have tested this and it worked fine with me, the xml example I use:
>>>>>
>>>>> <epackage
>>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>>
>>>>>
>>>>> <eclass name="Body">
>>>>> <property name="theID">
>>>>> <id/>
>>>>> </property>
>>>>> </eclass>
>>>>>
>>>>> <eclass name="Head">
>>>>> <transient/>
>>>>> </eclass>
>>>>>
>>>>> </epackage>
>>>>>
>>>>> Which Teneo version are you on?
>>>>>
>>>>> Btw, I have added the behavior that if an ereference references a
>>>>> transient eclass that then the ereference is also set to transient.
>>>>> This will be in a new release.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Forgot to add, the class XSMeasure does not 'contain' the features
>>>>>> it references.
>>>>>>
>>>>>> Duncan
>>>>>>
>>>>>> Duncan ALexander wrote:
>>>>>>> Hi,
>>>>>>> im having a problem with the Transient annotation when set on
>>>>>>> an EClass. Im using an annotations.xml file with the following
>>>>>>> entry:
>>>>>>>
>>>>>>> <epackage
>>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>>
>>>>>>> <eclass name="XSMeasure">
>>>>>>> <transient/>
>>>>>>> </eclass>
>>>>>>> </epackage>
>>>>>>>
>>>>>>> The ecore for this files looks like:
>>>>>>>
>>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>>> abstract="true">
>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>>> </eClassifiers>
>>>>>>>
>>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>>> uni-directional many-to-one references to other classes which are
>>>>>>> navigable only from XSMeasure.
>>>>>>>
>>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>>> mapping which Teneo generates but it always appears on
>>>>>>> re-generation.
>>>>>>>
>>>>>>> Other elements within the annotations.xml file are working as
>>>>>>> expected but never the Transient tag.
>>>>>>>
>>>>>>> Is this the correct syntax Im using here ?
>>>>>>>
>>>>>>> Any help is appreciated.
>>>>>>>
>>>>>>> Duncan
>>>>>
>>>>>
>>>
>>>
>
>
Re: [Teneo] : Transient annotation not working on EClass. [message #605033 is a reply to message #81072] Wed, 25 April 2007 11:52 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Duncan,
The xml is not translated into an eannotation but directly into the Transient instance being set in
the aClass.
There is a method call to: isMappableAnnotatedClass in the processAClass, if the aClass has
getTransient() != null then isMappableAnnotatedClass should return false, and no entity should be set.

Are you on the latest 0.7.5 release?

gr. Martin

Duncan ALexander wrote:
> Hi Martin,
> the entity (entity:
> org.eclipse.emf.teneo.annotations.pannotation.Entity ) member of the
> aClass is null at the start of processClass but it does get set at line
> 312 therefore the
> class does get processed once it reached
> HibernateMappingGenerator.processPAClass.
>
>
> I did notice that if I add an eAnnotation to the ecore file
> (Source=teneo.jpa value=@Transient)
> and debug into DefaultAnnotator.processClass then the annotated class
> does have
> an entry in the eAnnotations list (whereas it doesnt when only using the
> annotations.xml file).
>
> When processing hits line 290 and drops in the getEAnnotation method on
> the annotated class
> it processes further into the method than before but again drops out
> because it cannot
> find an annotation with the source="http://ejb.elver.org/Transient". The
> only annotation
> in the list has source="teneo.jpa"
>
> regards
>
> Duncan
>
>
> Martin Taal wrote:
>> Hi Duncan,
>> Is the entity member of the transient aClass set with an Entity
>> instance? In case of a transient eclass the defaultannotator should
>> not set an entity instance in the aClass.
>>
>> Can you also debug into the class HibernateMappingGenerator and then
>> the method: processPAClass. There the transient eclass should be
>> ignored because it should not have the entity set.
>>
>> gr. Martin
>>
>> Duncan ALexander wrote:
>>> Hi Martin,
>>> yes I already debugged into the processClass method and I can see
>>> that
>>> their is a Transient object in the transient member variable for this
>>> class.
>>> It would appear that it is picking it up ok from the annotations file
>>> but then somehow
>>> it is getting lost.
>>>
>>> Looking again.....I did notice in the processClass method at line 290
>>> there is a check
>>> to see if the class is Transient and it uses the getEAnnotation
>>> method on the annotated
>>> class and uses the key "http://ejb.elver.org/Transient", but when I
>>> debug into this method
>>> the eAnnotations list within the annotated class is empty and it
>>> drops straight out and
>>> continues to process as normal.
>>>
>>> regards
>>>
>>> Duncan
>>>
>>>
>>>
>>>
>>>
>>>
>>> Martin Taal wrote:
>>>> Hi Duncan,
>>>> Can you debug into the DefaultAnnotator class and then the
>>>> processClass method? For your transient eclass the aClass parameter
>>>> should have a member called transient with a Transient object. If
>>>> not then I know something is wrong in the annotation parsing.
>>>>
>>>> Btw, Teneo 0.7.5 has a test for transient but it uses the @Transient
>>>> annotation in the eannotation. The test I mentioned below is on
>>>> 0.8.0 for which I added also a transient annotation test with xml.
>>>>
>>>> gr. Martin
>>>>
>>>> Duncan ALexander wrote:
>>>>> Hi Martin,
>>>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>>>
>>>>> Ive tried the transient on a few different classes now always with
>>>>> the same results. Im making sure that the annotations.xml is being
>>>>> picked up correctly.
>>>>>
>>>>> My assumption was that there was some issue with references but I
>>>>> understood that only bidirectional
>>>>> references could prevent the transient class from not being persisted.
>>>>>
>>>>> Duncan
>>>>>
>>>>> Martin Taal wrote:
>>>>>> Hi Duncan,
>>>>>> I have tested this and it worked fine with me, the xml example I use:
>>>>>>
>>>>>> <epackage
>>>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>>>
>>>>>>
>>>>>> <eclass name="Body">
>>>>>> <property name="theID">
>>>>>> <id/>
>>>>>> </property>
>>>>>> </eclass>
>>>>>>
>>>>>> <eclass name="Head">
>>>>>> <transient/>
>>>>>> </eclass>
>>>>>>
>>>>>> </epackage>
>>>>>>
>>>>>> Which Teneo version are you on?
>>>>>>
>>>>>> Btw, I have added the behavior that if an ereference references a
>>>>>> transient eclass that then the ereference is also set to
>>>>>> transient. This will be in a new release.
>>>>>>
>>>>>> gr. Martin
>>>>>>
>>>>>> Duncan ALexander wrote:
>>>>>>> Forgot to add, the class XSMeasure does not 'contain' the
>>>>>>> features it references.
>>>>>>>
>>>>>>> Duncan
>>>>>>>
>>>>>>> Duncan ALexander wrote:
>>>>>>>> Hi,
>>>>>>>> im having a problem with the Transient annotation when set on
>>>>>>>> an EClass. Im using an annotations.xml file with the following
>>>>>>>> entry:
>>>>>>>>
>>>>>>>> <epackage
>>>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>>>
>>>>>>>> <eclass name="XSMeasure">
>>>>>>>> <transient/>
>>>>>>>> </eclass>
>>>>>>>> </epackage>
>>>>>>>>
>>>>>>>> The ecore for this files looks like:
>>>>>>>>
>>>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>>>> abstract="true">
>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference" name="Code"
>>>>>>>> lowerBound="1" eType="ecore:EClass codelist.ecore#//Code"/>
>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>>>> </eClassifiers>
>>>>>>>>
>>>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>>>> uni-directional many-to-one references to other classes which
>>>>>>>> are navigable only from XSMeasure.
>>>>>>>>
>>>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>>>> mapping which Teneo generates but it always appears on
>>>>>>>> re-generation.
>>>>>>>>
>>>>>>>> Other elements within the annotations.xml file are working as
>>>>>>>> expected but never the Transient tag.
>>>>>>>>
>>>>>>>> Is this the correct syntax Im using here ?
>>>>>>>>
>>>>>>>> Any help is appreciated.
>>>>>>>>
>>>>>>>> Duncan
>>>>>>
>>>>>>
>>>>
>>>>
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] : Transient annotation not working on EClass. [message #605048 is a reply to message #81087] Wed, 25 April 2007 14:14 Go to previous message
Duncan Alexander is currently offline Duncan AlexanderFriend
Messages: 90
Registered: July 2009
Member
Hi Martin,
that was it. I updated to the new build of 0.75 (Apr22) and it worked.
I can see the updated code in the processClass method which now deals with
Transient.

again, Many thanks.

Duncan

Martin Taal wrote:
> Hi Duncan,
> The xml is not translated into an eannotation but directly into the
> Transient instance being set in the aClass.
> There is a method call to: isMappableAnnotatedClass in the
> processAClass, if the aClass has getTransient() != null then
> isMappableAnnotatedClass should return false, and no entity should be set.
>
> Are you on the latest 0.7.5 release?
>
> gr. Martin
>
> Duncan ALexander wrote:
>> Hi Martin,
>> the entity (entity:
>> org.eclipse.emf.teneo.annotations.pannotation.Entity ) member of the
>> aClass is null at the start of processClass but it does get set at
>> line 312 therefore the
>> class does get processed once it reached
>> HibernateMappingGenerator.processPAClass.
>>
>>
>> I did notice that if I add an eAnnotation to the ecore file
>> (Source=teneo.jpa value=@Transient)
>> and debug into DefaultAnnotator.processClass then the annotated class
>> does have
>> an entry in the eAnnotations list (whereas it doesnt when only using
>> the annotations.xml file).
>>
>> When processing hits line 290 and drops in the getEAnnotation method
>> on the annotated class
>> it processes further into the method than before but again drops out
>> because it cannot
>> find an annotation with the source="http://ejb.elver.org/Transient".
>> The only annotation
>> in the list has source="teneo.jpa"
>>
>> regards
>>
>> Duncan
>>
>>
>> Martin Taal wrote:
>>> Hi Duncan,
>>> Is the entity member of the transient aClass set with an Entity
>>> instance? In case of a transient eclass the defaultannotator should
>>> not set an entity instance in the aClass.
>>>
>>> Can you also debug into the class HibernateMappingGenerator and then
>>> the method: processPAClass. There the transient eclass should be
>>> ignored because it should not have the entity set.
>>>
>>> gr. Martin
>>>
>>> Duncan ALexander wrote:
>>>> Hi Martin,
>>>> yes I already debugged into the processClass method and I can
>>>> see that
>>>> their is a Transient object in the transient member variable for
>>>> this class.
>>>> It would appear that it is picking it up ok from the annotations
>>>> file but then somehow
>>>> it is getting lost.
>>>>
>>>> Looking again.....I did notice in the processClass method at line
>>>> 290 there is a check
>>>> to see if the class is Transient and it uses the getEAnnotation
>>>> method on the annotated
>>>> class and uses the key "http://ejb.elver.org/Transient", but when I
>>>> debug into this method
>>>> the eAnnotations list within the annotated class is empty and it
>>>> drops straight out and
>>>> continues to process as normal.
>>>>
>>>> regards
>>>>
>>>> Duncan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Martin Taal wrote:
>>>>> Hi Duncan,
>>>>> Can you debug into the DefaultAnnotator class and then the
>>>>> processClass method? For your transient eclass the aClass parameter
>>>>> should have a member called transient with a Transient object. If
>>>>> not then I know something is wrong in the annotation parsing.
>>>>>
>>>>> Btw, Teneo 0.7.5 has a test for transient but it uses the
>>>>> @Transient annotation in the eannotation. The test I mentioned
>>>>> below is on 0.8.0 for which I added also a transient annotation
>>>>> test with xml.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Duncan ALexander wrote:
>>>>>> Hi Martin,
>>>>>> My setup is EMF 2.2, Teneo 0.75, Hibernate 3.3, JDK1.5
>>>>>>
>>>>>> Ive tried the transient on a few different classes now always with
>>>>>> the same results. Im making sure that the annotations.xml is being
>>>>>> picked up correctly.
>>>>>>
>>>>>> My assumption was that there was some issue with references but I
>>>>>> understood that only bidirectional
>>>>>> references could prevent the transient class from not being
>>>>>> persisted.
>>>>>>
>>>>>> Duncan
>>>>>>
>>>>>> Martin Taal wrote:
>>>>>>> Hi Duncan,
>>>>>>> I have tested this and it worked fine with me, the xml example I
>>>>>>> use:
>>>>>>>
>>>>>>> <epackage
>>>>>>> namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">
>>>>>>>
>>>>>>>
>>>>>>> <eclass name="Body">
>>>>>>> <property name="theID">
>>>>>>> <id/>
>>>>>>> </property>
>>>>>>> </eclass>
>>>>>>>
>>>>>>> <eclass name="Head">
>>>>>>> <transient/>
>>>>>>> </eclass>
>>>>>>>
>>>>>>> </epackage>
>>>>>>>
>>>>>>> Which Teneo version are you on?
>>>>>>>
>>>>>>> Btw, I have added the behavior that if an ereference references a
>>>>>>> transient eclass that then the ereference is also set to
>>>>>>> transient. This will be in a new release.
>>>>>>>
>>>>>>> gr. Martin
>>>>>>>
>>>>>>> Duncan ALexander wrote:
>>>>>>>> Forgot to add, the class XSMeasure does not 'contain' the
>>>>>>>> features it references.
>>>>>>>>
>>>>>>>> Duncan
>>>>>>>>
>>>>>>>> Duncan ALexander wrote:
>>>>>>>>> Hi,
>>>>>>>>> im having a problem with the Transient annotation when set
>>>>>>>>> on an EClass. Im using an annotations.xml file with the
>>>>>>>>> following entry:
>>>>>>>>>
>>>>>>>>> <epackage
>>>>>>>>> namespace-uri="http://www.sdmx.org/resources/infomodel/1.0/keyfamily.xmi">
>>>>>>>>>
>>>>>>>>> <eclass name="XSMeasure">
>>>>>>>>> <transient/>
>>>>>>>>> </eclass>
>>>>>>>>> </epackage>
>>>>>>>>>
>>>>>>>>> The ecore for this files looks like:
>>>>>>>>>
>>>>>>>>> <eClassifiers xsi:type="ecore:EClass" name="XSMeasure"
>>>>>>>>> abstract="true">
>>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>>>> name="Code" lowerBound="1" eType="ecore:EClass
>>>>>>>>> codelist.ecore#//Code"/>
>>>>>>>>> <eStructuralFeatures xsi:type="ecore:EReference"
>>>>>>>>> name="MeasureTypeDimension" lowerBound="1"
>>>>>>>>> eType="#//MeasureTypeDimension"/>
>>>>>>>>> </eClassifiers>
>>>>>>>>>
>>>>>>>>> The class XSMeasure has no superclass and contains only two
>>>>>>>>> uni-directional many-to-one references to other classes which
>>>>>>>>> are navigable only from XSMeasure.
>>>>>>>>>
>>>>>>>>> I would expect XSMeasure not to be included in the hibernate
>>>>>>>>> mapping which Teneo generates but it always appears on
>>>>>>>>> re-generation.
>>>>>>>>>
>>>>>>>>> Other elements within the annotations.xml file are working as
>>>>>>>>> expected but never the Transient tag.
>>>>>>>>>
>>>>>>>>> Is this the correct syntax Im using here ?
>>>>>>>>>
>>>>>>>>> Any help is appreciated.
>>>>>>>>>
>>>>>>>>> Duncan
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>
Previous Topic:How to unregister a TransactionalEditingDomain?
Next Topic:Validation - constraintProvider - package
Goto Forum:
  


Current Time: Thu Mar 28 13:18:43 GMT 2024

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

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

Back to the top