date fields / oracle

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

date fields / oracle

Roel van Dijk
I'm using Torque as part of Apache Jetspeed, and was wondering about
date fields. I've created a custom table, which has a column
declaration like this:

<column name="LAST_LOGIN"  type="DATE"/>

Then I do this in my Java code:

Date now = new Date();
entry.setLastLogin(now);

My Oracle (9) database now has this entry:
2002-05-09 00:00:00

As you can see, the time has not been stored. Is there a way to fix
this? (is there something like a datetime type?)

As a sidenote, where can I find a list of the available column types
that I can use in my XML schema?

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: date fields / oracle

Roel van Dijk
> As a sidenote, where can I find a list of the available column types
> that I can use in my XML schema?

And a related question: where can I find the mapping between these
column types (as defined in the XML schema), and the Java objects in
the created OM classes? (e.g. VARCHAR to String, INTEGER to int, DATE
to Date, etc..)

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: date fields / oracle

adam.s.allgaier
In reply to this post by Roel van Dijk
http://www.devaki.org/nextobjects/torque-type-map.html

Adam




                                                                       
                      bernard.noel@valloure                            
                      c.fr                           To:      "Apache Torque Users List" <[hidden email]>
                                                     cc:              
                                                     Subject: Réf. : Re: date fields / oracle
                      05/09/05 09:47 AM                                
                      Please respond to                                
                      "Apache Torque Users                            
                      List"                                            
                                                                       
                                                                       




For Torque 3.1 (OM classes generated with Ant)

\templates\sql\base\oracle\db.proprs




                    Roel van Dijk

                    <rdvdijk@gmai        Pour :  Apache Torque Users List
<[hidden email]>
                    l.com>               cc :

                                         Objet :      Re: date fields /
oracle
                    09/05/2005

                    16:26

                    Veuillez

                    répondre à

                    "Apache

                    Torque Users

                    List"







> As a sidenote, where can I find a list of the available column types
> that I can use in my XML schema?

And a related question: where can I find the mapping between these
column types (as defined in the XML schema), and the Java objects in
the created OM classes? (e.g. VARCHAR to String, INTEGER to int, DATE
to Date, etc..)

--
Roel -- [hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: date fields / oracle

Thomas Fischer-11




Hi,

to provide a little background: In the Torque 3.1.1 release, the Torque
types date, time and timestamp ar all mapped to oracle type Date.
Unfortunately, the underlying village library (not the database!) truncates
all dates to date accuracy. So, if plain 3.1.1 is used, all the above
Torque types have day accuracy.

However, it is possible to change the mapping of Torque type Timestamp to
oracle type timestamp in the oracle db.props file, which changes the
accuracy of Torque type timestamp to at least milliseconds. I am not sure
if you have to regenerate your object model afterwards, maybe you can just
alter the table in the database.
There is nothing easy to be done about the Torque type time, I'm afraid.

See also http://issues.apache.org/scarab/issues/id/TRQS263

    Thomas



[hidden email] schrieb am 09.05.2005 16:42:47:

> http://www.devaki.org/nextobjects/torque-type-map.html
>
> Adam
>
>
>
>
>

>                       bernard.noel@valloure

>                       c.fr                           To:
> "Apache Torque Users List" <[hidden email]>

>                                                      cc:

>                                                      Subject: Réf. :
> Re: date fields / oracle
>                       05/09/05 09:47 AM

>                       Please respond to

>                       "Apache Torque Users

>                       List"

>

>

>
>
>
>
> For Torque 3.1 (OM classes generated with Ant)
>
> \templates\sql\base\oracle\db.proprs
>
>
>
>
>                     Roel van Dijk
>
>                     <rdvdijk@gmai        Pour :  Apache Torque Users List
> <[hidden email]>
>                     l.com>               cc :
>
>                                          Objet :      Re: date fields /
> oracle
>                     09/05/2005
>
>                     16:26
>
>                     Veuillez
>
>                     répondre à
>
>                     "Apache
>
>                     Torque Users
>
>                     List"
>
>
>
>
>
>
>
> > As a sidenote, where can I find a list of the available column types
> > that I can use in my XML schema?
>
> And a related question: where can I find the mapping between these
> column types (as defined in the XML schema), and the Java objects in
> the created OM classes? (e.g. VARCHAR to String, INTEGER to int, DATE
> to Date, etc..)
>
> --
> Roel -- [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]