The java Date type is in fact a timestamp,
it contains date and time information. if nothing is
specified, Castor Doclet will map a Date to a timestamp :
|
<field name="dateValue" type="date">
<sql name="DATEVALUE" type="timestamp" />
<bind-xml name="dateValue" />
</field>
|
... and generate the corresponding DDL :
To keep just the date without time information, specify
a date sql-type :
|
/**
* @sql-type date
*/
private Date dateValue;
|
Obviouly, an sql-type of time will store only time.
If the date must be converted to a string in the database,
change the sql-type. As the column type is now a string,
the sql-size is also needed :
|
/**
* @sql-type char[dd/MM/yyyy]
* @sql-size 10
*/
private Date dateValue;
|
This will generate :
|
<field name="dateValue" type="date">
<sql type="char[dd/MM/yyyy]" name="DATEVALUE" />
<bind-xml name="dateValue" />
</field>
|
and
|