C.P.Krishnan:
Can I use castor�s Date with sql, or it is only for XML purposes?
My real problem is that Date has not enougth methods.
Thanks again.
"C.P.Krishnan
" Para: [EMAIL PROTECTED]
<[EMAIL PROTECTED] cc:
m> Asunto: Re: [castor-dev] Own classes
used by generated classes.
17/04/2002
12:56
Por favor,
responda a
castor-dev
Hi Gustavo
Date maps to org.exolab.castor.types.Date and not java.util.Date.
This is FYI.
Regards
C.P.Krishnan
-----Original Message-----
From: Gustavo Pistoia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 8:43 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Own classes used by generated classes.
Hi.
I wrote a class that is a date with some changes. I called it Fecha (date
in spanish). But when I tried to get it
from a database I got the following exception:
"No convertor exists for converting type java.sql.Date to type
egalar.udt.Fecha"
My classes.xsd file has an object using Fecha like this:
<xsd:complexType name="proyecto">
<xsd:sequence>
<xsd:element name="codigo" type="xsd:string"/>
<xsd:element name="fechaInicio" type="udt:fecha"/>
</xsd:sequence>
</xsd:complexType>
And my mapping.xml file is like this:
<class name="egalar.jdo.Proyecto" identity="codigo" access="shared">
<map-to table="rq021_proyecto"/>
<description>"Proyectos"</description>
<field name="codigo" type="string">
<sql name="codigo_proyecto" type="varchar"/>
</field>
<field name="fechaInicio" type="egalar.udt.Fecha">
<sql name="fecha_inicio_proy" type="date"/>
</field>
</class>
My Fecha class is like following:
public class Fecha implements java.io.Serializable {
...
/** Constructor */
public Tiempo() {
super();
}
/** Constructor */
public Tiempo(long value) {
super();
calendar.setTime(new Date(value));
}
/** Recupera el valor */
public java.util.Date getValue() {
return calendar.getTime();
}
/** Modifica el valor */
public void setValue(java.util.Date value) {
calendar.setTime(value);
}
}
I looked in the Castor sources and the convertions table are fixed. But I
know that is allowed to used extra classes from generated classes.
Thanks!!!! Gracias!!! Grazzie!!!! Obrigado!!!
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev