-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: @Column and @Length column length problem
PostPosted: Tue Mar 27, 2007 10:48 am 
Newbie

Joined: Tue Mar 27, 2007 10:23 am
Posts: 1
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 6:09 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
mplement you own Length and LengthValidator

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.