This one time, at band camp, Konrad said:
K>When a class field has the java.util.Date type, does K>Castor store the time with the date as well? We are K>using Oracle9i, and I have the following Castor K>mapping: K> K> <field name="entryDate" type="date"> K> <sql name="ENTRY_TS" type="date"/> K> </field> K> K>However, in the database, the HH:mm:ss is appearing as K>00:00:00 (or not appearing at all, depending on sql K>query client). K> K>Is this standard for the Date mapping (to only store K>the date and no time at all)? K> K>We are unable to use TIMESTAMP as the type for the K>database field due to a WebLogic6.1sp2 JDBC driver K>limitation (not recognizing Oracle9i's Timestamp K>type)...
Konrad,
There are a few mappings in src/tests/jdo/mapping.xml for the jdo.TestTypes object for the java.util.Date object:
1) A mapping for the java.util.Date to a SQL integer with a parameter (e.g. integer[YMD] ). Internally Castor converts the java.util.Date to a java.lang.Integer to be persisted.
2) A mapping for the java.util.Date to a SQL char with a parameter (e.g. char[yyyy/MM/dd HH:mm:ss.SSS]). Internally Castor converts the java.util.Date to a String to be persisted.
3) A mapping for the java.util.Date to a SQL numeric with a parameter (e.g. numeric[YMDhmsS]). Internally Castor converts the java.util.Date to a java.math.BigDecimal to be persisted.
4) A mapping for the java.util.Date to a SQL bigint with no parameter. Internally Castor converts this to java.math.BigDecimal to be persisted.
In cases at least cases 2 and 3 above, the time is persisted. I can't say for sure on case 4.
The src/tests/jdo/mapping.xml descriptor is available in the source download or CVS.
Bruce
Thanks for your reply Bruce.
So in the case where a Java Date is mapped to an SQL "date", then is only the date (and not the time) retained when storing to the database?
Thank you. :)
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
