The content of element type "session-factory" must match "(property*,mapping*,(class-cache| collect

配置hibernate.cfg.xml时提示The content of element type "session-factory" must match "(property*,mapping*,(class-cache|  collection-cache)*,event*,listener*)".的错。

   提示先配置property*元素,再配置mapping*元素,依次类推,仔细检查下看看你的程序中是否存在配置顺序错乱的情况。

只是因为在

<hibernate-configuration>


<session-factory>


</session-factory>

</hibernate-configuration>

之间存在元素配置顺序的错误,只需要按提示将顺序调整正确即可。 

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