cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Baldwin <jfbald...@earthlink.net>
Subject Re: Problems with Date in Cayenne 2.0.4
Date Wed, 28 Jan 2009 15:12:59 GMT
Andrus,

I looked up the Oracle Date definition and it does in fact keep time  
info in the database.  My (admittedly novice) solution was to map it  
via Modeler to a TIMESTAMP.  Does this reveal the same problem with  
the Oracle adapter as mapping it via Modeler-DATE?

Joe


On Jan 28, 2009, at 9:58 AM, Andrus Adamchik wrote:

> I guess that's how Oracle driver returns the metadata for the DATE  
> column in the ResultSet. The workaround is to use #result()  
> directive in the SQL:
>
>   http://cayenne.apache.org/doc20/scripting-sqltemplate.html
>
> Hope this helps,
>
> Andrus
>
> On Jan 28, 2009, at 4:48 PM, Alessio Giovanni Baroni wrote:
>
>> Hi to all,
>> I have the following code:
>>
>> .............
>> query = new SQLTemplate("SELECT FOO FROM BAR");
>> results = ctxt.performQuery(Bar.class, query);
>> for(int i = 0; i < results.size() - 1; ++i)
>> {
>>       Bar f = (Bar)results.get(i);
>>       ...... (f.getFoo());
>>       ....................
>> }
>>
>> In the Oracle DB the field FOO is a DATE and I map it to  
>> java.util.Date.
>> When I do .getFoo(), the date that I have is without the
>> hours/minutes/seconds.
>> Why? How do I resolve it?
>>
>> Thanks.
>


Mime
View raw message