I'm having a problem inserting timestamp values to "created_date" and "modified_date" columns, when i save an entity, no exception is throwed but NULL value is inserted into "created_date" and "modified_date" columns instead of a timestamp, all other columns(which do not use "generated") are inserted with proper data.
I tried using <timestamp> but the results were same.
I'm using MySQL 5 and Hibernate 3.3.1
This is the mapping definition from one the mapping files
Quote:
<property name="createdDate" column="created_date" update="false"
insert="false" generated="insert" access="field" type="timestamp" not-null="true" />
<property name="modifiedDate" column="modified_date" update="false"
insert="false" generated="always" access="field" type="timestamp" not-null="true" />
In dao class the getter/setters are as follows
Quote:
public Date getCreatedDate() {
return createdDate;
}
private void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
public Date getModifiedDate() {
return modifiedDate;
}
private void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
Please help