配置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>
之間存在元素配置順序的錯誤,只需要按提示將順序調整正確即可。