在hibernate.xml中的class加入dynamic-insert="true" dynamic-update="true"
數(shù)據(jù)庫中表字段必須設(shè)置默認(rèn)值
如:<class name="com.hibernate.bean" table="TABLE" schema="DATABASE" dynamic-insert="true" dynamic-update="true" >
注:dynamic-insert="true" dynamic-update="true" 的作用是當(dāng)HQL語句中未指明的列將不進(jìn)行insert和update操作,這樣hibernate就不會在未指明默認(rèn)列的情況下將數(shù)據(jù)庫表中默認(rèn)值字段清空。
posted on 2010-06-12 15:41
紫蝶∏飛揚(yáng)↗ 閱讀(1687)
評論(0) 編輯 收藏 所屬分類:
Hibernate