gpt4 book ai didi

java - 使用 http ://www. hibernate.org/dtd 的 Hibernate 问题

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:41:16 25 4
gpt4 key购买 nike

<分区>

我目前正在使用 http://hibernate.sourceforge.net作为我的 hibernate 配置文件中的命名空间,它给我这些警告:

Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!

所以我尝试将 hibernate.cfg.xml 和所有其他 *.hbm.xml 文件切换为使用 http://www.hibernate.org/dtd .然而,当我尝试在 eclipse 中使用 hibernate 工具生成代码时,我收到以下错误消息(代码生成在其他命名空间下工作正常):

org.hibernate.HibernateException: Could not parse configuration: C:\dev\workspace\DataLoad\hibernate.cfg.xml Could not parse configuration: C:\dev\workspace\DataLoad\hibernate.cfg.xml
org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hibernate.org www.hibernate.org Nested exception: www.hibernate.org org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hibernate.org www.hibernate.org Nested exception: www.hibernate.org

这是我的 hibernate.cfg.xml:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/findata?tcpKeepAlive=true
</property>
<property name="connection.username">root</property>
<property name="connection.password">xxxxxxxx</property>

<property name="connection.pool_size">2</property>
<property name="show_sql">true</property>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="current_session_context_class">thread</property>
<property name="cache.provider_class">
org.hibernate.cache.NoCacheProvider
</property>

<mapping resource="conf/Alert.hbm.xml" />
<mapping resource="conf/Entity.hbm.xml" />
<mapping resource="conf/FactData.hbm.xml" />
<mapping resource="conf/TimeEvent.hbm.xml" />
<mapping resource="conf/User.hbm.xml" />
<mapping resource="conf/AlertTarget.hbm.xml" />
<mapping resource="conf/LogAlert.hbm.xml" />
<mapping resource="conf/RepeatType.hbm.xml" />
<mapping resource="conf/Schedule.hbm.xml" />
<mapping resource="conf/Task.hbm.xml" />
<mapping resource="conf/JobQueue.hbm.xml" />
<mapping resource="conf/LogTask.hbm.xml" />
<mapping resource="conf/Exclude.hbm.xml" />
<mapping resource="conf/LogNotification.hbm.xml" />
<mapping resource="conf/Job.hbm.xml" />
<mapping resource="conf/Metric.hbm.xml" />
<mapping resource="conf/EntityGroup.hbm.xml" />
<mapping resource="conf/ExtractSingle.hbm.xml" />
</session-factory>
</hibernate-configuration>

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com