Hi
We use castor 1.0 for ORACLE. We still having problems with timestamp field.
This is our mapping xml.
<class name="com.test.web.util.Material" identity="id" key-generator="seqgen_material">
       <description>Material</description>
       <map-to table="MATERIAL" xml="group"/>
       <field name="id" type="long">
           <sql name="ME_ID" type="bigint" />
       </field>
       <field name="materialDateTime" type="timestamp">
           <sql name="MATERIAL_DATE" type="timestamp" dirty="ignore"/>
       </field>
   </class>

Oracle database's data type for this field is DATE.

Sometimes we got weird dates like '9/16/2036 7:18:09 PM' in our database. There is no way user can enter the dates.Application generates those dates. materialDateTime field is java.sql.Timestamp. We set this materialDateTime field using another member variable called meDate. Application get and set the materialDateTime by
   public Date getMeDate()
   {
       return this.getMaterialDateTime();
   }
   public void setMeDate(java.util.Date date)
   {
       this.setMaterialDateTime(new Timestamp(date.getTime()));
   }
Most of the time we set meDate value using
java.util.Date date = new java.util.Date();
   setMeDate(date );
or java.util.Calendar calendar = java.util.Calendar.getInstance(java.util.TimeZone.getDefault());
   setMeDate(calendar.getTime());

Let me know if you need more info

--
Rajesh Muthu



---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to