I'm trying to change the date format in the marshalled xml file using a FieldHandler, 
without success. Be grateful if someone could point me in the right direction, I have 
the feeling I'm barking up the wrong tree.

Mapping file....
 <field name="qdate"   handler="quote.FrDateFormat" type = "date">
    <sql name="QU_DATE" type="date" dirty="ignore" />
      <xml node="element" />
    </field>

FieldHandler....
public class FrDateFormat extends GeneralizedFieldHandler {
   private static final SimpleDateFormat DateFormatter = new 
SimpleDateFormat("MM:dd:yyyy");
   static {
     DateFormatter.setLenient(false);
   }

 public Object convertUponGet(Object value) {
     return DateFormatter.format((java.sql.Date) value);
   }

Error.....
java.lang.ClassCastException

        at org.exolab.castor.jdo.engine.SQLEngine$FieldInfo.<init>(SQLEngine.java:1451)

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to