<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.ibm.heyang.XXX">
<class name="XXXClas" table="XXX_Table">
<id name="id" column="ID" >
<generator class="increment"/>
</id>
<property name="name" column="name" not-null="true"/>
<property name="content" type="text">
<column name="content" length = "16777216" />
</property>
</class>
</hibernate-mapping>
以上length="16777216"
是关键,它会把字段对应到MySql的LONGTEXT类型.
以上是受到
http://sonyfe25cp.iteye.com/blog/830566
启发的.
===========
来自:http://www.blogjava.net/heyang/archive/2013/04/02/397323.html