1. 程式人生 > >org.hibernate.MappingException: must specify an identifier type:

org.hibernate.MappingException: must specify an identifier type:

出現這個問題的原因是由於在hbm.xml配置檔案中,id缺少name屬性導致的,

我的出現錯誤的配置檔案部分程式碼如下:

         <id column="itemid" >
<generator class="native" />
</id>

由於在id中,沒有配置name,所以就報錯了。新增上name=“oid”之後,問題解決。