-->
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.  [ 1 post ] 
Author Message
 Post subject: Persist object error : Data too long for column (in MySql)
PostPosted: Mon Aug 01, 2011 12:08 pm 
Newbie

Joined: Thu May 05, 2011 12:35 pm
Posts: 1
Hi,

I am having an error when persisting a Model Object with attribute :

Code:
@Required
@Column(name="url", length=1000)
@Length(max=1000)
public String url;


I use "jpa.ddl=create" in Play Framework application.conf to generate the tables in the first execution. DDL creates a column url of type "longtext" in the MySql database.

When I save the object, I have the following error :
Code:
(JDBCExceptionReporter.java:233) - SQL Error: 1406, SQLState: 22001
(JDBCExceptionReporter.java:234) - Data truncation: Data too long for column 'url' at row 1


The URL that causes me this problem has a length of 305 caracters.

I tried to increase the size of JPA annotation @Column to 10000 and to explicitly specify argument "columnDefinition=longtext" but it doesn't solve the problem.

Any ideas ?

Version of play is 1.2.2.
Version of mysql Jconnector is 5.1.17.
Version of hibernate-core is 3.6.1.
Version of hibernate-entitymanager is 3.6.0

Thx by advance


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

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.