dimavin wrote:
Is there a way to specify date/time format in the mapping file
for property value conversion between java.lang.String and Sybase datetime?
Not as far as I know but you can do it yourself in your java class.
Code:
public class MyClass {
private String dateString;
public Date getDate() {
return dateParser.parse(dateString);
}
public void setDate(Date aDate) {
this.dateString = dateParser.format(aDate);
}
...
}
In your Hibernate mapping file, persist the 'date' property and not the dateString...
Code:
<class MyClass>
...
<property name="date" />
...
</class>
Note: why do you keep in your dates in String format - you should convert them as soon as possible in java.util.Date...
[/code]