What does the length attribute do when set on the @Column JPA annontation?
- by James McMahon
What exactly does setting the length on a column do in JPA?
@Column(name = "middle_name", nullable = false, length = 32)
public String getMiddleName() {
return this.middleName;
}
I understand that you can use the annotations to generate the database schema based on the entity objects, but does length do any sort of check or truncation when persistence happens, or it solely used for schema creation?
I also realize that JPA can sit on top of various implementations, the implementation I am concerned with in this case, is Hibernate.