There are three TemporalTypes you can work with, DATE, TIME and TIMESTAMP.
Quote:
When storing time based information in a database, it can be stored in one of three ways: as a time, as a date, or as a time-date combination known as a TIMESTAMP. If the Hibernate framework sees a time based property, it will be treated as a TIMESTAMP unless you tell Hibernate otherwise. For the instances of the Calendar and Date fields in our User class, we will decorate the getters for our fields with a @Temporal annotation, and use the TemporalType constants to clarify the property as being of type TIME, DATE or TIMESTAMP.
Using JPA annotations, they'd look like this. Not exactly a solution to your mapping file, but it might point you in the right direction:
Code:
@Temporal(TemporalType.TIMESTAMP)
public java.util.Date getLastAccessTime() {
return lastAccessTime;
}
Code:
@Temporal(TemporalType.DATE)
public java.util.Calendar getRegistrationDate() {
return registrationDate;
}
I pulled this info from a tutorial on column mappings, from my website. You might find it useful:
http://jpa.ezhibernate.com/Javacode/learn.jsp?tutorial=06hibernatetableandcolumnmappingwithjpa
Good luck!