In Database, We have size varchar(30).
From source we are getting data of 31 chars
In Hibernate, The field is mentioned like
@Column("ColumnName")
private String columnName;
We have around 100 to 200 such columns having varchar for different databases.
Is there a way to trim the data first and then set it to Hibernate setter or is there any way in hibernate to do so for say 150 out of 200 columns?
The approach i am following is to check database column length substring the same at setter something like -> len > 30? substring(0,30): len ; but is there any good solution to this or hibernate specific solution to this?