Hibernate version: 3.2.0.GA
Name and version of the database you are using: DB2 8.2
Hello i'm using hibernate validation framework and i have a problem with @Column and @Length annotations.
Here is my code: (i removed the id part beacuse it's not important)
Code:
@NotNull
@Length(max=50)
@Column(length=63)
private String someName;
And here is log from hbm2ddl
Code:
create table SOME_TABLE (id bigint generated by default as identity, someName varchar(50) not null, primary key (id))
As you see the column length is taken from @Length, which I think is wrong because, you i can't have column longer than validation.
Also in case DB2 database - DB2 takes length in bytes so 50 means not 50 characters but 50 bytes which is complicated in UTF-8 or other encoding (character can be bigger than 1 byte).
Also if i would like to have validation on some size and before save want to add sth to this column i couldn't do it because column size is wrong.
Is there any possibility to change the column length and size of validation (with different values) ?
Artur