I fixed this behavior with a simple UserType. Just annotate
| import org.hibernate.annotations.Type;
| ...
| @Column(name = XYZ)
| @Type(type = usertype.TrimmedStringType)
| private String xyz;
|
The TrimmedStringType source is like this:
| package usertype;
|
| import
Thanks a lot! That worked for my char-datatype.
Do you have an idea how to deal with MEDIUMTEXT as (mysql) database type?
What's the best java.sql.Type I can use for it?
Thanks,
Chris
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4031609#4031609
Reply to
Ok, this was an easy one @Column(length = 10) did the trick.
Thanks!
Chris
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4031614#4031614
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4031614
I have the same problem. There is a char(3) column in my mysql database I
cannot change. What's the right java type I can map this to in my @Entity?
char[], Character[] etc/ gives me an Varchar expected exception.
Thanks,
Chris
View the original post :
Hi,
Could you not just annotate the getter/variable with something like so:
@Column(columnDefinition=VARCHAR2(size))
Cheers
Andy
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3993767#3993767
Reply to the post :
The 'columDefinition' just helps the PersistenceProvider to set up the right
DDL for the Table when you set it up to create the Tables at Deployment
:-(
But thanks
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=3993877#3993877
Reply to the post :