Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Solution for XMLGregorianCalendar problems
[Teneo] Solution for XMLGregorianCalendar problems [message #112668] Tue, 19 February 2008 22:11 Go to next message
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Hi Martin,

I really dislike XMLGregorianCalendar (XGC). It's constantly giving me
ClassCastExceptions and my environment has the IBM, Apache and Sun
versions of these things running around.

I so strongly dislike this class that I wrote and eclipe tool which
automatically refactors any EMF generated objects to switch from using
XMLGregorianCalendar into using the objects from Joda Time
(http://joda-time.sourceforge.net/)

So the refactoring works nicely. My Joda Time methods call wrap the
original EMF getters and setters so that my users never see XGC and EMF
continues to use the objects it expects internally.

Unfortunately, Teneo is pretty much hard coded to use XGC, the same way
EMF is. But it seems like I could make a new property and get this
working by modifying these classes:
AbstractMapper: Switch the defaults based on an option
ECoreDataTypes: Add some methods
XSDDateTime: control behavior by option
XSDDate: control behavior by option

If I have even a hope of you accepting a change like this I'll write it
up and submit it. If you're completely disinterested I'll be forced to
make my wrapper methods @transient, the XGC methods @depricated and then
have my users work via the transient stuff while Teneo works via the
deprecated stuff. I think I can make that work, but it's certainly not
as nice as building the support into Teneo.

I would write the mod as a plug-in so that you wouldn't have to directly
depend on the Joda Time code. Basically, you'd set the option and point
to a 'DateTimeProvider' class that would implement inside the objects
shown above. Then I could offer a JodaDateTimeProvider that would do
what I need.

Let me know what you think. As long as you aren't completely against
the idea I'll write it up and submit it.

Jason
Re: [Teneo] Solution for XMLGregorianCalendar problems [message #112682 is a reply to message #112668] Wed, 20 February 2008 15:41 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Jason,
Have you tried using a hibernate usertype for handling the gregoriancalendar? Or would combining a
specific usertype with some of your changes result in less changes?

btw, I am interested to solve this. So if you can open a bugzilla then we can discuss in the
bugzilla how to solve this in the best (least invasive and most intuitive, etc.) way.

gr. Martin

jason henriksen wrote:
>
> Hi Martin,
>
> I really dislike XMLGregorianCalendar (XGC). It's constantly giving me
> ClassCastExceptions and my environment has the IBM, Apache and Sun
> versions of these things running around.
>
> I so strongly dislike this class that I wrote and eclipe tool which
> automatically refactors any EMF generated objects to switch from using
> XMLGregorianCalendar into using the objects from Joda Time
> (http://joda-time.sourceforge.net/)
>
> So the refactoring works nicely. My Joda Time methods call wrap the
> original EMF getters and setters so that my users never see XGC and EMF
> continues to use the objects it expects internally.
>
> Unfortunately, Teneo is pretty much hard coded to use XGC, the same way
> EMF is. But it seems like I could make a new property and get this
> working by modifying these classes:
> AbstractMapper: Switch the defaults based on an option
> ECoreDataTypes: Add some methods
> XSDDateTime: control behavior by option
> XSDDate: control behavior by option
>
> If I have even a hope of you accepting a change like this I'll write it
> up and submit it. If you're completely disinterested I'll be forced to
> make my wrapper methods @transient, the XGC methods @depricated and then
> have my users work via the transient stuff while Teneo works via the
> deprecated stuff. I think I can make that work, but it's certainly not
> as nice as building the support into Teneo.
>
> I would write the mod as a plug-in so that you wouldn't have to directly
> depend on the Joda Time code. Basically, you'd set the option and point
> to a 'DateTimeProvider' class that would implement inside the objects
> shown above. Then I could offer a JodaDateTimeProvider that would do
> what I need.
>
> Let me know what you think. As long as you aren't completely against
> the idea I'll write it up and submit it.
>
> Jason


--

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] Solution for XMLGregorianCalendar problems [message #615518 is a reply to message #112668] Wed, 20 February 2008 15:41 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Jason,
Have you tried using a hibernate usertype for handling the gregoriancalendar? Or would combining a
specific usertype with some of your changes result in less changes?

btw, I am interested to solve this. So if you can open a bugzilla then we can discuss in the
bugzilla how to solve this in the best (least invasive and most intuitive, etc.) way.

gr. Martin

jason henriksen wrote:
>
> Hi Martin,
>
> I really dislike XMLGregorianCalendar (XGC). It's constantly giving me
> ClassCastExceptions and my environment has the IBM, Apache and Sun
> versions of these things running around.
>
> I so strongly dislike this class that I wrote and eclipe tool which
> automatically refactors any EMF generated objects to switch from using
> XMLGregorianCalendar into using the objects from Joda Time
> (http://joda-time.sourceforge.net/)
>
> So the refactoring works nicely. My Joda Time methods call wrap the
> original EMF getters and setters so that my users never see XGC and EMF
> continues to use the objects it expects internally.
>
> Unfortunately, Teneo is pretty much hard coded to use XGC, the same way
> EMF is. But it seems like I could make a new property and get this
> working by modifying these classes:
> AbstractMapper: Switch the defaults based on an option
> ECoreDataTypes: Add some methods
> XSDDateTime: control behavior by option
> XSDDate: control behavior by option
>
> If I have even a hope of you accepting a change like this I'll write it
> up and submit it. If you're completely disinterested I'll be forced to
> make my wrapper methods @transient, the XGC methods @depricated and then
> have my users work via the transient stuff while Teneo works via the
> deprecated stuff. I think I can make that work, but it's certainly not
> as nice as building the support into Teneo.
>
> I would write the mod as a plug-in so that you wouldn't have to directly
> depend on the Joda Time code. Basically, you'd set the option and point
> to a 'DateTimeProvider' class that would implement inside the objects
> shown above. Then I could offer a JodaDateTimeProvider that would do
> what I need.
>
> Let me know what you think. As long as you aren't completely against
> the idea I'll write it up and submit it.
>
> Jason


--

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
Previous Topic:[Teneo] Solution for XMLGregorianCalendar problems
Next Topic:resource
Goto Forum:
  


Current Time: Fri Apr 26 16:29:24 GMT 2024

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

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

Back to the top