You know, annotations make things so much easier.
@Temporal(TemporalType.TIMESTAMP)
public java.util.Date getLastAccessTime() {
return lastAccessTime;
}
@Temporal(TemporalType.DATE)
public java.util.Calendar getRegistrationDate() {
return registrationDate;
}
Performing Date and Time Column Mappings with Hibernate and JPA Annotations
DATE vs. TIME vs. TIMESTAMP
It's noteworthy to point out how the registrationDate column, which is annotated to be TemporalType.DATE, simply gets a year-month-day value, whereas the lastAccessTime column is populated with a full timestamp, including both the day and the time (TemporalType.TIME is the third option which would have simply saved the time, and not the calendar day). By the way, TemporalType.TIMESTAMP is the default if it isn't otherwise specified in your code.
-Cameron McKenzie