日期:2014-05-16  浏览次数:20561 次

hibernate插入数据库默认值
<?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">
<!--
??? Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
??? <class name="bean.JzNote" table="JZ_NOTE" schema="TEST" dynamic-insert="true" dynamic-update="true">
??????? <id name="noteId" type="java.lang.Long">
??????????? <column name="NOTE_ID" precision="9" scale="0" />
??????????? <generator class="sequence">
??????????? <param name="sequence">SN_JZ_NOTE_ID</param>
??????????? </generator>
??????? </id>
??????? <many-to-one name="jzUser" class="bean.JzUser" fetch="select">
??????????? <column name="USER_ID" precision="9" scale="0" not-null="true" />
??????? </many-to-one>
??????? <property name="noteTitle" type="java.lang.String">
??????????? <column name="NOTE_TITLE" length="200" not-null="true" />
??????? </property>
??????? <property name="noteContent" type="text" length="10000">
??????????? <column name="NOTE_CONTENT" not-null="true" />
??????? </property>
??????? <property name="filePath" type="java.lang.String">
??????????? <column name="FILE_PATH" length="200" />
??????? </property>
??????? <property name="addDate" type="java.util.Date">
??????????? <column name="ADD_DATE" length="7" not-null="false" />
??????? </property>
??????? <property name="modDate" type="java.util.Date">
??????????? <column name="MOD_DATE" length="7" not-null="false" />
??????? </property>
??????? <property name="state" type="java.lang.Long">
??????????? <column name="STATE" precision="1" scale="0" not-null="false" />
??????? </property>
??????? <set name="jzSubNotes" inverse="true">
??????????? <key>
??????????????? <column name="NOTE_ID" precision="9" scale="0" not-null="true" />
??????????? </key>
??????????? <one-to-many class="bean.JzSubNote" />
??????? </set>
??? </class>
</hibernate-mapping>