teneo - java.util.Date mapped to DATE, time information is lost [message #60996] |
Sun, 12 November 2006 17:34  |
Eclipse User |
|
|
|
Hi,
I have attributes of type java.sql.Date in my model. These are mapped to SQL
type DATE (tested in HSQLDB and MySQL) so it loses the time information after
reading back the value.
I have tried it with a java.sql.Timestamp but this was also mapped to DATE and
the time information was lost.
Can you recommend how to map java.util.Date correctly? I would like to use the
java.util.Date type if possible. Only if there is no way how to do it, then I
would fall back to a long or even a formatted string (but those 2 would be
harder to handle on the GUI).
Any suggestions?
Thanks
Andre
|
|
|
|
Re: teneo - java.util.Date mapped to DATE, time information is lost [message #61042 is a reply to message #61020] |
Sun, 12 November 2006 18:39  |
Eclipse User |
|
|
|
Thanks Martin, the @Temporal annotation does it perfectly...
Martin Taal wrote:
> Hi,
> As a default Teneo currently adds a temporal annotation to a
> java.util.date type, the default value of this temporal annotation is
> date (other values are time and timestamp). You can override this by
> setting a temporal annotation with value timestamp on the efeature (or
> edatatype). I have no test case for this yet.
>
> As an extra remark. I think that a default of timestamp is better. I
> will change it. In the meantime you can try the temporal annotation.
>
> gr. Martin
>
> Andre Pareis wrote:
>> Hi,
>>
>> I have attributes of type java.sql.Date in my model. These are mapped
>> to SQL type DATE (tested in HSQLDB and MySQL) so it loses the time
>> information after reading back the value.
>>
>> I have tried it with a java.sql.Timestamp but this was also mapped to
>> DATE and the time information was lost.
>>
>> Can you recommend how to map java.util.Date correctly? I would like to
>> use the java.util.Date type if possible. Only if there is no way how
>> to do it, then I would fall back to a long or even a formatted string
>> (but those 2 would be harder to handle on the GUI).
>>
>> Any suggestions?
>>
>> Thanks
>> Andre
>
>
|
|
|
Re: teneo - java.util.Date mapped to DATE, time information is lost [message #595490 is a reply to message #60996] |
Sun, 12 November 2006 18:30  |
Eclipse User |
|
|
|
Hi,
As a default Teneo currently adds a temporal annotation to a java.util.date type, the default value
of this temporal annotation is date (other values are time and timestamp). You can override this by
setting a temporal annotation with value timestamp on the efeature (or edatatype). I have no test
case for this yet.
As an extra remark. I think that a default of timestamp is better. I will change it. In the meantime
you can try the temporal annotation.
gr. Martin
Andre Pareis wrote:
> Hi,
>
> I have attributes of type java.sql.Date in my model. These are mapped to
> SQL type DATE (tested in HSQLDB and MySQL) so it loses the time
> information after reading back the value.
>
> I have tried it with a java.sql.Timestamp but this was also mapped to
> DATE and the time information was lost.
>
> Can you recommend how to map java.util.Date correctly? I would like to
> use the java.util.Date type if possible. Only if there is no way how to
> do it, then I would fall back to a long or even a formatted string (but
> those 2 would be harder to handle on the GUI).
>
> Any suggestions?
>
> Thanks
> Andre
--
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 - java.util.Date mapped to DATE, time information is lost [message #595501 is a reply to message #61020] |
Sun, 12 November 2006 18:39  |
Eclipse User |
|
|
|
Thanks Martin, the @Temporal annotation does it perfectly...
Martin Taal wrote:
> Hi,
> As a default Teneo currently adds a temporal annotation to a
> java.util.date type, the default value of this temporal annotation is
> date (other values are time and timestamp). You can override this by
> setting a temporal annotation with value timestamp on the efeature (or
> edatatype). I have no test case for this yet.
>
> As an extra remark. I think that a default of timestamp is better. I
> will change it. In the meantime you can try the temporal annotation.
>
> gr. Martin
>
> Andre Pareis wrote:
>> Hi,
>>
>> I have attributes of type java.sql.Date in my model. These are mapped
>> to SQL type DATE (tested in HSQLDB and MySQL) so it loses the time
>> information after reading back the value.
>>
>> I have tried it with a java.sql.Timestamp but this was also mapped to
>> DATE and the time information was lost.
>>
>> Can you recommend how to map java.util.Date correctly? I would like to
>> use the java.util.Date type if possible. Only if there is no way how
>> to do it, then I would fall back to a long or even a formatted string
>> (but those 2 would be harder to handle on the GUI).
>>
>> Any suggestions?
>>
>> Thanks
>> Andre
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04761 seconds