Hibernate映射文件

2016-07-14  本文已影响24人  浅晨夕

名称:Example.hbm.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
    <class name="com.troyforever.example.data.bean.Test" table="test" schema="example">
    
        <id name="id" type="java.lang.Integer" column="id">
            <generator class="identity">
            </generator>
        </id>
        
        <property name="age" type="java.lang.Integer">
            <column name="age" not-null="true" />
        </property>

        <property name="content" type="java.lang.String">
            <column name="content" length="2000" not-null="true" />
        </property>
        
        <property name="addtime" type="java.util.Date">
            <column name="addtime" />
        </property>
    </class>
</hibernate-mapping>

上一篇下一篇

猜你喜欢

热点阅读