(轉載)這個是DBunit的問題,1.8以上的版本才有這個問題!
只要修改User.java
/**
???? * @return Returns the enabled.
???? * @hibernate.property column="enabled"?
???? */
??? public Boolean getEnabled() {
??????? // isEnabled doesnt' work for copying properties to Struts ActionForms
??????? return enabled;
??? }
修改成
/**
???? * @return Returns the enabled.
???? * @hibernate.property column="enabled"
type="yes_no"???? */
??? public Boolean getEnabled() {
??????? // isEnabled doesnt' work for copying properties to Struts ActionForms
??????? return enabled;
??? }
就加了這一點,就可以了,
其實 type="yes_no" hibernate會映射成CHAR(1) , 而type="boolean" 它會映射成BIT , 估計dbunit在插入sample-data.xml的時候會出錯。
posted on 2006-10-26 14:15
選寶網an9 閱讀(340)
評論(0) 編輯 收藏 所屬分類:
FRAMEWORK