MySql中LongText字段對應Hibernate映射文件的設置

<?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"app

是關鍵,它會把字段對應到MySql的LONGTEXT類型.

以上是受到.net

http://sonyfe25cp.iteye.com/blog/830566hibernate

啓發的.code

相關文章
相關標籤/搜索