配置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>
之间存在元素配置顺序的错误,只需要按提示将顺序调整正确即可。
本文介绍了解决Hibernate配置文件hibernate.cfg.xml中的元素顺序错误问题,确保<session-factory>标签内的元素遵循正确的顺序:property*、mapping*、class-cache等。

2566

被折叠的 条评论
为什么被折叠?



