Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » JPA Temporal annotation doesn't work for EReference features
JPA Temporal annotation doesn't work for EReference features [message #127259] Fri, 18 July 2008 17:21 Go to next message
koloale is currently offline koloaleFriend
Messages: 41
Registered: July 2009
Member
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 #127271 is a reply to message #127259] Fri, 18 July 2008 17:40 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5340
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 #127282 is a reply to message #127271] Fri, 18 July 2008 20:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
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
>
>
Re: JPA Temporal annotation doesn't work for EReference features [message #127353 is a reply to message #127282] Mon, 21 July 2008 09:13 Go to previous messageGo to next message
koloale is currently offline koloaleFriend
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5340
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5340
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
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
>
>
Re: JPA Temporal annotation doesn't work for EReference features [message #620132 is a reply to message #127282] Mon, 21 July 2008 09:13 Go to previous message
koloale is currently offline koloaleFriend
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5340
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
Previous Topic:teneo: client/server scenario
Next Topic:[EMF Compare] GenericMatchEngine - Lists of java.lang.String aren't being matched
Goto Forum:
  


Current Time: Mon Dec 22 23:30:41 GMT 2014

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

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