Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » JPA Temporal annotation doesn't work for EReference features
|
Re: JPA Temporal annotation doesn't work for EReference features [message #127271 is a reply to message #127259] |
Fri, 18 July 2008 17:40 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Alexey,
The Temporal attribute can be used but only on an EAttribute. It specifies that the EAttribute is a
date or time. So I think you would need something else.
The transient attribute can be used to prevent serializing to xml but this attribute is also used by
Teneo.
Ed, is there another EMF attribute which can be used?
btw, I cross-posted to the EMF newsgroup as support for Teneo is given there.
gr. Martin
koloale wrote:
> Hello,
>
> When I specify JPA @Temporal annotation on EReference feature I get the
> following exception:
> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
> eclass: HbAnnotatedEReference does not have an efeature for Temporal
>
> Is it correct? The reason I use @Temporal annotation instead of
> transient="true" property is that I want to have an attribute persisted
> with teneo, but not serialized by XMLResoure. Is any workaround for this
> case?
>
> Thanks in advance for any your answers
> Regards,
> Alexey Koloskov
--
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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
| |
Re: JPA Temporal annotation doesn't work for EReference features [message #127353 is a reply to message #127282] |
Mon, 21 July 2008 09:13 |
koloale Messages: 41 Registered: July 2009 |
Member |
|
|
Sorry, I confused @Transient annotation with @Temporal.
So, I can add this annotation to not persist features that haven't
transient="true" propery set on model.
But now I also need to persist fields marked as transient in Ecore model
with Teneo in DB, in order to solve my problem of serializing some
fileds in XML but not in DB and vice versa. Is there any ways to do
this? One way is to manualy unSet features that I don't want to
serialize in XML. May be there is some annotation that force Teneo to
persist features let pass transient="true" property?
Ed Merks пишет:
> Martin,
>
> No, only transient things aren't serialized. And things for which
> eIsSet returns false...
>
>
> Martin Taal wrote:
>> Hi Alexey,
>> The Temporal attribute can be used but only on an EAttribute. It
>> specifies that the EAttribute is a date or time. So I think you would
>> need something else.
>> The transient attribute can be used to prevent serializing to xml but
>> this attribute is also used by Teneo.
>>
>> Ed, is there another EMF attribute which can be used?
>>
>> btw, I cross-posted to the EMF newsgroup as support for Teneo is given
>> there.
>>
>> gr. Martin
>>
>> koloale wrote:
>>> Hello,
>>>
>>> When I specify JPA @Temporal annotation on EReference feature I get
>>> the following exception:
>>> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
>>> The eclass: HbAnnotatedEReference does not have an efeature for Temporal
>>>
>>> Is it correct? The reason I use @Temporal annotation instead of
>>> transient="true" property is that I want to have an attribute
>>> persisted with teneo, but not serialized by XMLResoure. Is any
>>> workaround for this case?
>>>
>>> Thanks in advance for any your answers
>>> Regards,
>>> Alexey Koloskov
>>
>>
|
|
|
Re: JPA Temporal annotation doesn't work for EReference features [message #127366 is a reply to message #127353] |
Mon, 21 July 2008 09:39 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Alexey,
There is currently no way of doing this. You can add a bugzilla for this, so I can add an option to
control this.
As a workaround a (very) dirty trick would be to set the Transient to false (in the in-memory
structuralfeature) then let Teneo do the mapping (is done in the datastore.initialize step) and then
programmatically repair the transient value in the structural feature after the datastore.initialize.
gr. Martin
koloale wrote:
> Sorry, I confused @Transient annotation with @Temporal.
> So, I can add this annotation to not persist features that haven't
> transient="true" propery set on model.
>
> But now I also need to persist fields marked as transient in Ecore model
> with Teneo in DB, in order to solve my problem of serializing some
> fileds in XML but not in DB and vice versa. Is there any ways to do
> this? One way is to manualy unSet features that I don't want to
> serialize in XML. May be there is some annotation that force Teneo to
> persist features let pass transient="true" property?
>
> Ed Merks пишет:
>> Martin,
>>
>> No, only transient things aren't serialized. And things for which
>> eIsSet returns false...
>>
>>
>> Martin Taal wrote:
>>> Hi Alexey,
>>> The Temporal attribute can be used but only on an EAttribute. It
>>> specifies that the EAttribute is a date or time. So I think you would
>>> need something else.
>>> The transient attribute can be used to prevent serializing to xml but
>>> this attribute is also used by Teneo.
>>>
>>> Ed, is there another EMF attribute which can be used?
>>>
>>> btw, I cross-posted to the EMF newsgroup as support for Teneo is
>>> given there.
>>>
>>> gr. Martin
>>>
>>> koloale wrote:
>>>> Hello,
>>>>
>>>> When I specify JPA @Temporal annotation on EReference feature I get
>>>> the following exception:
>>>> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
>>>> The eclass: HbAnnotatedEReference does not have an efeature for
>>>> Temporal
>>>>
>>>> Is it correct? The reason I use @Temporal annotation instead of
>>>> transient="true" property is that I want to have an attribute
>>>> persisted with teneo, but not serialized by XMLResoure. Is any
>>>> workaround for this case?
>>>>
>>>> Thanks in advance for any your answers
>>>> Regards,
>>>> Alexey Koloskov
>>>
>>>
--
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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: JPA Temporal annotation doesn't work for EReference features [message #620124 is a reply to message #127259] |
Fri, 18 July 2008 17:40 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Alexey,
The Temporal attribute can be used but only on an EAttribute. It specifies that the EAttribute is a
date or time. So I think you would need something else.
The transient attribute can be used to prevent serializing to xml but this attribute is also used by
Teneo.
Ed, is there another EMF attribute which can be used?
btw, I cross-posted to the EMF newsgroup as support for Teneo is given there.
gr. Martin
koloale wrote:
> Hello,
>
> When I specify JPA @Temporal annotation on EReference feature I get the
> following exception:
> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
> eclass: HbAnnotatedEReference does not have an efeature for Temporal
>
> Is it correct? The reason I use @Temporal annotation instead of
> transient="true" property is that I want to have an attribute persisted
> with teneo, but not serialized by XMLResoure. Is any workaround for this
> case?
>
> Thanks in advance for any your answers
> Regards,
> Alexey Koloskov
--
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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: JPA Temporal annotation doesn't work for EReference features [message #620125 is a reply to message #127271] |
Fri, 18 July 2008 20:32 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Martin,
No, only transient things aren't serialized. And things for which
eIsSet returns false...
Martin Taal wrote:
> Hi Alexey,
> The Temporal attribute can be used but only on an EAttribute. It
> specifies that the EAttribute is a date or time. So I think you would
> need something else.
> The transient attribute can be used to prevent serializing to xml but
> this attribute is also used by Teneo.
>
> Ed, is there another EMF attribute which can be used?
>
> btw, I cross-posted to the EMF newsgroup as support for Teneo is given
> there.
>
> gr. Martin
>
> koloale wrote:
>> Hello,
>>
>> When I specify JPA @Temporal annotation on EReference feature I get
>> the following exception:
>> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
>> The eclass: HbAnnotatedEReference does not have an efeature for Temporal
>>
>> Is it correct? The reason I use @Temporal annotation instead of
>> transient="true" property is that I want to have an attribute
>> persisted with teneo, but not serialized by XMLResoure. Is any
>> workaround for this case?
>>
>> Thanks in advance for any your answers
>> Regards,
>> Alexey Koloskov
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: JPA Temporal annotation doesn't work for EReference features [message #620132 is a reply to message #127282] |
Mon, 21 July 2008 09:13 |
koloale Messages: 41 Registered: July 2009 |
Member |
|
|
Sorry, I confused @Transient annotation with @Temporal.
So, I can add this annotation to not persist features that haven't
transient="true" propery set on model.
But now I also need to persist fields marked as transient in Ecore model
with Teneo in DB, in order to solve my problem of serializing some
fileds in XML but not in DB and vice versa. Is there any ways to do
this? One way is to manualy unSet features that I don't want to
serialize in XML. May be there is some annotation that force Teneo to
persist features let pass transient="true" property?
Ed Merks пишет:
> Martin,
>
> No, only transient things aren't serialized. And things for which
> eIsSet returns false...
>
>
> Martin Taal wrote:
>> Hi Alexey,
>> The Temporal attribute can be used but only on an EAttribute. It
>> specifies that the EAttribute is a date or time. So I think you would
>> need something else.
>> The transient attribute can be used to prevent serializing to xml but
>> this attribute is also used by Teneo.
>>
>> Ed, is there another EMF attribute which can be used?
>>
>> btw, I cross-posted to the EMF newsgroup as support for Teneo is given
>> there.
>>
>> gr. Martin
>>
>> koloale wrote:
>>> Hello,
>>>
>>> When I specify JPA @Temporal annotation on EReference feature I get
>>> the following exception:
>>> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
>>> The eclass: HbAnnotatedEReference does not have an efeature for Temporal
>>>
>>> Is it correct? The reason I use @Temporal annotation instead of
>>> transient="true" property is that I want to have an attribute
>>> persisted with teneo, but not serialized by XMLResoure. Is any
>>> workaround for this case?
>>>
>>> Thanks in advance for any your answers
>>> Regards,
>>> Alexey Koloskov
>>
>>
|
|
|
Re: JPA Temporal annotation doesn't work for EReference features [message #620134 is a reply to message #127353] |
Mon, 21 July 2008 09:39 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Alexey,
There is currently no way of doing this. You can add a bugzilla for this, so I can add an option to
control this.
As a workaround a (very) dirty trick would be to set the Transient to false (in the in-memory
structuralfeature) then let Teneo do the mapping (is done in the datastore.initialize step) and then
programmatically repair the transient value in the structural feature after the datastore.initialize.
gr. Martin
koloale wrote:
> Sorry, I confused @Transient annotation with @Temporal.
> So, I can add this annotation to not persist features that haven't
> transient="true" propery set on model.
>
> But now I also need to persist fields marked as transient in Ecore model
> with Teneo in DB, in order to solve my problem of serializing some
> fileds in XML but not in DB and vice versa. Is there any ways to do
> this? One way is to manualy unSet features that I don't want to
> serialize in XML. May be there is some annotation that force Teneo to
> persist features let pass transient="true" property?
>
> Ed Merks пишет:
>> Martin,
>>
>> No, only transient things aren't serialized. And things for which
>> eIsSet returns false...
>>
>>
>> Martin Taal wrote:
>>> Hi Alexey,
>>> The Temporal attribute can be used but only on an EAttribute. It
>>> specifies that the EAttribute is a date or time. So I think you would
>>> need something else.
>>> The transient attribute can be used to prevent serializing to xml but
>>> this attribute is also used by Teneo.
>>>
>>> Ed, is there another EMF attribute which can be used?
>>>
>>> btw, I cross-posted to the EMF newsgroup as support for Teneo is
>>> given there.
>>>
>>> gr. Martin
>>>
>>> koloale wrote:
>>>> Hello,
>>>>
>>>> When I specify JPA @Temporal annotation on EReference feature I get
>>>> the following exception:
>>>> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
>>>> The eclass: HbAnnotatedEReference does not have an efeature for
>>>> Temporal
>>>>
>>>> Is it correct? The reason I use @Temporal annotation instead of
>>>> transient="true" property is that I want to have an attribute
>>>> persisted with teneo, but not serialized by XMLResoure. Is any
>>>> workaround for this case?
>>>>
>>>> Thanks in advance for any your answers
>>>> Regards,
>>>> Alexey Koloskov
>>>
>>>
--
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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Goto Forum:
Current Time: Fri Apr 26 19:35:09 GMT 2024
Powered by FUDForum. Page generated in 0.04814 seconds
|