Hibernate 3.1.1, Annotations 3.1B8, EntityManager 3.1B6, Oracle 10g
The SchemaValidator objects to a Oracle column declared with the DATA datatype and annotated as TemporalType.TIMESTAMP.
The SchemaValidator complains:
Code:
javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: LAST_UPDATE, expected: timestamp
on a persistent property declared as
Code:
@Column(name="LAST_UPDATE", unique=false, nullable=false, insertable=true, updatable=true, length=7)
@Temporal(TemporalType.TIMESTAMP)
public Date getLastUpdate() {
return this.lastUpdate;
}
with DDL
Code:
CREATE TABLE plate (..., last_update DATE NOT NULL, ...)
In Oracle, the DATE datatype contains both date and time information, much like java.lang.Date, so a TIMESTAMP temporal type should be a valid mapping.
Indeed it is the only valid mapping, because while attempts to use TemporalType.DATE or TemporalType.TIME in the above example pass the SchemaValidator, they yeild Java Dates that contain only the date or time portions, respectively.
From a brief review of the Hibernate code, it seems that each Dialect maps to an appropriate type, potentially out of several, while the validator thinks that is the only valid mapping.
--keenan