如何修复已识别的过时hibernate命名空间警告信息

如何修复已识别的过时hibernate命名空间警告信息,hibernate,Hibernate,我的代码: Configuration [INFO] HHH000043: Configuring from resource: com/logiware/webtool/hibernates/hibernate.cfg.xml Configuration [INFO] HHH000040: Configuration resource: com/logiware/webtool/hibernates/hibernate.cfg.xml Configuration [INFO] HHH000

我的代码:

Configuration [INFO] HHH000043: Configuring from resource: com/logiware/webtool/hibernates/hibernate.cfg.xml

Configuration [INFO] HHH000040: Configuration resource: com/logiware/webtool/hibernates/hibernate.cfg.xml

Configuration [INFO] HHH000221: Reading mappings from resource: com/logiware/webtool/hibernate/domain/BookingTerminal.hbm.xml

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

Configuration [INFO] HHH000221: Reading mappings from resource: com/logiware/webtool/hibernate/domain/Bkgtemplate.hbm.xml

org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
线
com.gp.cong.hibernate.dirtydial
假的
50
com.mysql.jdbc.Driver
真的
真的
真的

只需将hibernate.cfg.xml文件命名空间定义更改为如下所示:

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                    -->
<hibernate-configuration>

<session-factory>
<property name="connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property>
<property name="current_session_context_class">thread</property>
<property name="dialect">com.gp.cong.hibernate.DirtyDialect</property>
<property name="show_sql">false</property>
    <property name="hibernate.jdbc.batch_size">50</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
    <!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration.dtd">

类似地,对于hibernate映射文件,将其更改为如下所示:

<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                    -->
<hibernate-configuration>

<session-factory>
<property name="connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property>
<property name="current_session_context_class">thread</property>
<property name="dialect">com.gp.cong.hibernate.DirtyDialect</property>
<property name="show_sql">false</property>
    <property name="hibernate.jdbc.batch_size">50</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
    <!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration.dtd">

这是一个正确的答案

<!DOCTYPE hibernate-mapping PUBLIC  
 "-//Hibernate/Hibernate Mapping DTD//EN"  
 "http://hibernate.org/dtd/hibernate-mapping.dtd">