Hi,
Supose I have this in an entity:
Code:
@Column(length = 4)
public void setName(String name) {
this.name = name;
}
So in the database the column is a varchar(4).
When i try to persist the class with somethin like "eduardo" in the name field, I get an Hibernate Exception.
Is there any way for Hibernate to allow bigger strings truncating them ? For instance, myClass.setName("eduardo") followed by a persist call would go without exceptions, and I would have "edua" persisted on the database. That's what I want...
Is there any way to do it with annotations?
Thank you very much!