What if we use
@Column(name=\"birth_date\", nullable=false, length=19)
public Date getBirthDate() {
return this.birthDate;
}
instead of
I realize this question was already answered but we struggled with this today so I wanted to give some more insight for future people who stumble across this.
Using Oracle 11g with the version 11 drivers if you do not use the temporal annotation then every date, time, and timestamp data type from Oracle will map to a timestamp in your code at runtime. Functionally this is fine, however this caused us severe performance issues. This was because we had a DATE type as part of a compound primary key. This column was the leading column of the index as well as the column we used for partitioning. When the driver would try to persist records with this column in the where clause Oracle would perform a type conversion of the data in the DB from DATE to TIMESTAMP. This made the index useless and performance was horrible.
Long story longer, add this annotation always lest ye be prepared to pay the price.