首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

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

2012-08-24 
Caused by: org.hibernate.MappingException: must specify an identifier type:异常:Caused by: org.hibe

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

异常:Caused by: org.hibernate.MappingException: must specify an identifier type:

view plaincopy to clipboardprint?


Caused by: org.hibernate.MappingException: must specify an identifier type: com.xycentre.otms.usermanager.model.OtmsUser??
??? at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:418)??
??? at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:356)??
??? at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)??
??? at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)?
Caused by: org.hibernate.MappingException: must specify an identifier type: com.xycentre.otms.usermanager.model.User
?at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:418)
?at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:356)
?at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
?at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)

?

解决方案:

User.hbm.xml里id的name没有写..

把ID里面的name属性写上,就没事.

?

<id name="userID" column="USER_ID" type="java.lang.String">
???<generator class="native"></generator>??

</id>

热点排行