You can use Length annotation for a column. By using it you can maximize or minimize column length. Length annotation only be used for Strings
.
@Column(name = "NAME", nullable = false, length = 50)
@Length(max = 50)
public String getName() {
return this.name;
}
You need to alter your table. Increase the column width using a DDL statement.
please see here
http://dba-oracle.com/t_alter_table_modify_column_syntax_example.htm
Use @Column
annotation and define its length
attribute. Check Hibernate's documentation for references (section 2.2.2.3).
@Column(name = Columns.COLUMN_NAME, columnDefinition = "NVARCHAR(MAX)")
max
indicates that the maximum storage size is 2^31-1 bytes (2 GB)
Source: Stackoverflow.com