Hi,
Assume I have the following column definition:
Code:
@Column(name = "account_no", nullable = false, length = 10)
public String getAccountNo() {
return this.accountNo;
}
If I create a new entity, set the account number to null, and try to save the entity, I get a HibernateException without ever touching the database.
If I create a new entity, set the account number to a string longer than 10 digits, and try to save the entity, I get a MysqlDataTruncation from the database.
Hibernate seems to be checking the nullable attribute before trying to save, but not checking the length attribute. Is this expected behaviour?
Thanks,
mers