读书人

Hibernate 插入 MySQL LongText 错误

发布时间: 2012-11-16 14:12:14 作者: rapoo

Hibernate 插入 MySQL LongText 异常
一、异常如下:

14:30:50,484 ERROR JDBCExceptionReporter:72 - Data truncation: Data too long for column 'content' at row 1
org.hibernate.exception.GenericJDBCException: could not insert: [com.jh.xh.hibernate.pojo.InfoTab]

二、程序代码:

private String content;

public void setContent(String content) {
this.content = content;
}
public String getContent() {
return this.content;
}

对应xml配置:

<property name="content" type="text">
<column name="content" />
</property>

插入不到数据库表中。

<column name="Id" />
<generator class="native"></generator>
</id>

插入少量可以,但内容多的话就报错了。 3 楼 saysoc 2007-03-20 content类型不对吧,换个可以装大数据的类型 4 楼 xhcat1025 2007-03-23 问题不在这里,原因我写到我的另一博客了
http://maomao.blog.51cto.com

读书人网 >Mysql

热点推荐