有關hibernate添加對象時生成表的問題!!

1.在生成表文件時,這個type的類型爲integer纔可以生成在數據庫中生成表,但是在後期的操作過程時,你必須改爲string,不然的話,會出現錯誤!!

<class name="roomDetail" table="z_roomDetail">
<id name="id" type="string">
<generator class="native"/>
</id>
<property name="roomNo" type="string"/>
<property name="roomFuction" type="string"/>
<property name="roomDesc" type="string"/>
<property name="roomControlId" type="string"/>
</class>
</hibernate-mapping>

至於什麼原因暫時未定,還沒有明白!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章