如何摆脱 "HHH90000003: Use of DOM4J entity-mode is considered deprecated"
How to get rid of "HHH90000003: Use of DOM4J entity-mode is considered deprecated"
我刚刚将项目的休眠版本升级到 5.0。0.FINAL。但是我意识到,我收到了这个警告。我想摆脱它。不知道会不会影响我的申请。
2015-08-24 14:29:22.235 WARN --- [ main] org.hibernate.orm.deprecation : HHH90000003: Use of DOM4J entity-mode is considered deprecated
由于我从来没有明确地使用过entity-mode,所以我在网上搜索了几乎没有关于它的信息。这是 EntityMode 枚举。因为,不再有 DOM4J
模式,我怀疑如果我继续在 5.0.0.
版本中使用休眠,我可能会在生产中出错
我也在休眠中使用envers。如果我禁用 envers 警告也会 disappears.I 与 hibernate 和 envers 一起使用 spring。这是它们的版本。
<spring.version>4.2.0.RELEASE</spring.version>
<hibernate.version>5.0.0.Final</hibernate.version>
<hibernate.envers.version>5.0.0.Final</hibernate.envers.version>
<hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
<project.java.version>1.8</project.java.version>
这是我的 hibernate-jpa 配置。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="commonsEntityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="commonDataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.ejb.interceptor">com.examples.dao.utils.AbstractEntityInterceptor</prop>
<!--<prop key="hibernate.listeners.envers.autoRegister">false</prop>-->
<prop key="hibernate.implicit_naming_strategy">org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl</prop>
<prop key="hibernate.physical_naming_strategy">org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.showSql">${hibernate.showSql}</prop>
<prop key="hibernate.formatSql">${hibernate.formatSql}</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
<prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
<prop key="hibernate.default_batch_fetch_size">${hibernate.default_batch_fetch_size}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="org.hibernate.envers.audit_table_suffix">${org.hibernate.envers.audit_table_suffix}</prop>
<prop key="javax.persistence.sharedCache.mode">${javax.persistence.sharedCache.mode}</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com.examples.entity</value>
</list>
</property>
</bean>
<bean id="commonsTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="commonsEntityManagerFactory"/>
</bean>
<tx:annotation-driven transaction-manager="commonsTransactionManager"/>
<context:component-scan base-package="com.examples.dao.*"/>
</beans>
这是一个示例实体。
@Entity
@Table(name = "T_USER")
@Access(AccessType.FIELD)
@Audited
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "C_USERNAME", unique = true)
private String username;
@Column(name = "C_PASSWORD")
private String password;
@Column(name = "C_EMAIL")
private String email;
// Getters && Setters etc
}
更新
我在 github that demonstrates this behaviour. After debugging a little, I found out that the warning message is created on ModelBinder#L2441 上创建了一个项目。
示例代码如下:
public class ModelBinder
...
private void bindProperty(
MappingDocument mappingDocument,
AttributeSource propertySource,
Property property) {
property.setName( propertySource.getName() );
if ( StringHelper.isNotEmpty( propertySource.getName() ) ) {
// Here is the line that print outs the log I was mentioned
DeprecationLogger.DEPRECATION_LOGGER.logDeprecationOfDomEntityModeSupport();
}
...
}
}
当我查看 mappingDocument.getOrigin()
的值时,它是 Origin(name=envers,type=OTHER)
。所以我仍然怀疑是 envers 引起了这个警告。
顺便说一句,如果您删除 @Audit
注释,或使用我提到的 属性,此警告仍然会消失。
我使用与@bhdrkn 相同的环境
<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="database">
<bean factory-method="getDatabase" class="net.gelif.core.persistence.Hibernates">
<constructor-arg ref="dataSource"/>
</bean>
</property>
</bean>
</property>
<property name="packagesToScan">
<array>
<value>net.gelif.**.entity</value>
</array>
</property>
<property name="sharedCacheMode" value="ENABLE_SELECTIVE"/>
<property name="jpaProperties">
<props>
<prop key="#{T(org.hibernate.cfg.AvailableSettings).HBM2DDL_AUTO}">update</prop><!-- hibernate.hbm2ddl.auto -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).DEFAULT_ENTITY_MODE}">pojo</prop><!-- hibernate.default_entity_mode -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).CURRENT_SESSION_CONTEXT_CLASS}">thread</prop><!-- hibernate.current_session_context_class -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).CACHE_REGION_FACTORY}">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop><!-- hibernate.cache.region.factory_class -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).USE_SECOND_LEVEL_CACHE}">true</prop><!-- hibernate.cache.use_second_level_cache -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).USE_QUERY_CACHE}">true</prop><!-- hibernate.cache.use_query_cache -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).SHOW_SQL}">false</prop><!-- hibernate.show_sql -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).MAX_FETCH_DEPTH}">3</prop><!-- hibernate.max_fetch_depth -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS}">false</prop><!-- hibernate.discriminator.ignore_explicit_for_joined -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).USE_NEW_ID_GENERATOR_MAPPINGS}">true</prop><!-- hibernate.id.new_generator_mappings -->
<prop key="#{T(org.hibernate.jpa.AvailableSettings).VALIDATION_MODE}">none</prop><!-- javax.persistence.validation.mode -->
<prop key="#{T(org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory).NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME}">cache/ehcache-hibernate-local.xml</prop><!-- net.sf.ehcache.configurationResourceName -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).AUDIT_TABLE_PREFIX}"></prop><!-- org.hibernate.envers.audit_table_prefix 配置数据修改记录表名的前缀规则 默认值:空 -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).AUDIT_TABLE_SUFFIX}">_audit</prop><!-- org.hibernate.envers.audit_table_suffix 配置数据修改记录表名的后缀规则 默认值:_AUD -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).REVISION_FIELD_NAME}">revision</prop><!-- org.hibernate.envers.revision_field_name 配置数据修改记录表版本号字段名 默认值: REV -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).REVISION_TYPE_FIELD_NAME}">revision_type</prop><!-- org.hibernate.envers.revision_type_field_name 配置数据修改记录表修改类型字段名 默认值: REVTYPE . 0表示新增加,1修改 2删除 -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).REVISION_ON_COLLECTION_CHANGE}">true</prop><!-- org.hibernate.envers.revision_on_collection_change 配置是否支持关联表修改时记录修改记录 默认值:true-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).DO_NOT_AUDIT_OPTIMISTIC_LOCKING_FIELD}">true</prop><!-- org.hibernate.envers.do_not_audit_optimistic_locking_field 配置是否不对乐观锁字段修改时记录修改记录,即使用(@Version)字段 默认值:true-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).STORE_DATA_AT_DELETE}">true</prop><!-- org.hibernate.envers.store_data_at_delete 配置是否在删除操作时,只保存id值还是全部的值。 默认值:false 只记录id-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).DEFAULT_SCHEMA}"></prop><!-- org.hibernate.envers.default_schema 配置数据修改记录表的schema 默认值:null-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).DEFAULT_CATALOG}"></prop><!-- org.hibernate.envers.default_catalog 配置数据修改记录表的catalog 默认值:null-->
</props>
</property>
</bean>
<!-- Spring Data Jpa配置, 扫描base-package下所有继承于Repository<T,ID>的接口 -->
<jpa:repositories base-package="net.gelif.ems.**.dao.**" repository-impl-postfix="Impl" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="jpaTransactionManager"/>
<!-- 事务管理器配置, Jpa单数据源事务 -->
<bean id="jpaTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="jpaTransactionManager" proxy-target-class="true"/>
当我从实体中删除 hibernate envers 设置和 @Audit 时,这些警告消失了。
我认为这些消息是由 ModelBinder 中的错误引起的。而不是 getName 应该是 getXmlNodeName。我已经报告了这个问题,我希望这将在下一个版本中得到修复。无论如何,除了额外的日志行,没有任何其他后果。
此问题已在此处发布的新休眠版本中修复:http://in.relation.to/2015/09/30/hibernate-orm-502-final-release/。
参见 https://hibernate.atlassian.net/browse/HHH-10115
升级后问题应该解决了。
我刚刚将项目的休眠版本升级到 5.0。0.FINAL。但是我意识到,我收到了这个警告。我想摆脱它。不知道会不会影响我的申请。
2015-08-24 14:29:22.235 WARN --- [ main] org.hibernate.orm.deprecation : HHH90000003: Use of DOM4J entity-mode is considered deprecated
由于我从来没有明确地使用过entity-mode,所以我在网上搜索了几乎没有关于它的信息。这是 EntityMode 枚举。因为,不再有 DOM4J
模式,我怀疑如果我继续在 5.0.0.
我也在休眠中使用envers。如果我禁用 envers 警告也会 disappears.I 与 hibernate 和 envers 一起使用 spring。这是它们的版本。
<spring.version>4.2.0.RELEASE</spring.version>
<hibernate.version>5.0.0.Final</hibernate.version>
<hibernate.envers.version>5.0.0.Final</hibernate.envers.version>
<hibernate-jpa-2.1-api.version>1.0.0.Final</hibernate-jpa-2.1-api.version>
<project.java.version>1.8</project.java.version>
这是我的 hibernate-jpa 配置。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="commonsEntityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="commonDataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/>
</property>
<property name="jpaDialect">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.ejb.interceptor">com.examples.dao.utils.AbstractEntityInterceptor</prop>
<!--<prop key="hibernate.listeners.envers.autoRegister">false</prop>-->
<prop key="hibernate.implicit_naming_strategy">org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl</prop>
<prop key="hibernate.physical_naming_strategy">org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.showSql">${hibernate.showSql}</prop>
<prop key="hibernate.formatSql">${hibernate.formatSql}</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
<prop key="hibernate.max_fetch_depth">${hibernate.max_fetch_depth}</prop>
<prop key="hibernate.default_batch_fetch_size">${hibernate.default_batch_fetch_size}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="org.hibernate.envers.audit_table_suffix">${org.hibernate.envers.audit_table_suffix}</prop>
<prop key="javax.persistence.sharedCache.mode">${javax.persistence.sharedCache.mode}</prop>
</props>
</property>
<property name="packagesToScan">
<list>
<value>com.examples.entity</value>
</list>
</property>
</bean>
<bean id="commonsTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="commonsEntityManagerFactory"/>
</bean>
<tx:annotation-driven transaction-manager="commonsTransactionManager"/>
<context:component-scan base-package="com.examples.dao.*"/>
</beans>
这是一个示例实体。
@Entity
@Table(name = "T_USER")
@Access(AccessType.FIELD)
@Audited
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "C_USERNAME", unique = true)
private String username;
@Column(name = "C_PASSWORD")
private String password;
@Column(name = "C_EMAIL")
private String email;
// Getters && Setters etc
}
更新
我在 github that demonstrates this behaviour. After debugging a little, I found out that the warning message is created on ModelBinder#L2441 上创建了一个项目。
示例代码如下:
public class ModelBinder
...
private void bindProperty(
MappingDocument mappingDocument,
AttributeSource propertySource,
Property property) {
property.setName( propertySource.getName() );
if ( StringHelper.isNotEmpty( propertySource.getName() ) ) {
// Here is the line that print outs the log I was mentioned
DeprecationLogger.DEPRECATION_LOGGER.logDeprecationOfDomEntityModeSupport();
}
...
}
}
当我查看 mappingDocument.getOrigin()
的值时,它是 Origin(name=envers,type=OTHER)
。所以我仍然怀疑是 envers 引起了这个警告。
顺便说一句,如果您删除 @Audit
注释,或使用我提到的 属性,此警告仍然会消失。
我使用与@bhdrkn 相同的环境
<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="database">
<bean factory-method="getDatabase" class="net.gelif.core.persistence.Hibernates">
<constructor-arg ref="dataSource"/>
</bean>
</property>
</bean>
</property>
<property name="packagesToScan">
<array>
<value>net.gelif.**.entity</value>
</array>
</property>
<property name="sharedCacheMode" value="ENABLE_SELECTIVE"/>
<property name="jpaProperties">
<props>
<prop key="#{T(org.hibernate.cfg.AvailableSettings).HBM2DDL_AUTO}">update</prop><!-- hibernate.hbm2ddl.auto -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).DEFAULT_ENTITY_MODE}">pojo</prop><!-- hibernate.default_entity_mode -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).CURRENT_SESSION_CONTEXT_CLASS}">thread</prop><!-- hibernate.current_session_context_class -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).CACHE_REGION_FACTORY}">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop><!-- hibernate.cache.region.factory_class -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).USE_SECOND_LEVEL_CACHE}">true</prop><!-- hibernate.cache.use_second_level_cache -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).USE_QUERY_CACHE}">true</prop><!-- hibernate.cache.use_query_cache -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).SHOW_SQL}">false</prop><!-- hibernate.show_sql -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).MAX_FETCH_DEPTH}">3</prop><!-- hibernate.max_fetch_depth -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).IGNORE_EXPLICIT_DISCRIMINATOR_COLUMNS_FOR_JOINED_SUBCLASS}">false</prop><!-- hibernate.discriminator.ignore_explicit_for_joined -->
<prop key="#{T(org.hibernate.cfg.AvailableSettings).USE_NEW_ID_GENERATOR_MAPPINGS}">true</prop><!-- hibernate.id.new_generator_mappings -->
<prop key="#{T(org.hibernate.jpa.AvailableSettings).VALIDATION_MODE}">none</prop><!-- javax.persistence.validation.mode -->
<prop key="#{T(org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory).NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME}">cache/ehcache-hibernate-local.xml</prop><!-- net.sf.ehcache.configurationResourceName -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).AUDIT_TABLE_PREFIX}"></prop><!-- org.hibernate.envers.audit_table_prefix 配置数据修改记录表名的前缀规则 默认值:空 -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).AUDIT_TABLE_SUFFIX}">_audit</prop><!-- org.hibernate.envers.audit_table_suffix 配置数据修改记录表名的后缀规则 默认值:_AUD -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).REVISION_FIELD_NAME}">revision</prop><!-- org.hibernate.envers.revision_field_name 配置数据修改记录表版本号字段名 默认值: REV -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).REVISION_TYPE_FIELD_NAME}">revision_type</prop><!-- org.hibernate.envers.revision_type_field_name 配置数据修改记录表修改类型字段名 默认值: REVTYPE . 0表示新增加,1修改 2删除 -->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).REVISION_ON_COLLECTION_CHANGE}">true</prop><!-- org.hibernate.envers.revision_on_collection_change 配置是否支持关联表修改时记录修改记录 默认值:true-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).DO_NOT_AUDIT_OPTIMISTIC_LOCKING_FIELD}">true</prop><!-- org.hibernate.envers.do_not_audit_optimistic_locking_field 配置是否不对乐观锁字段修改时记录修改记录,即使用(@Version)字段 默认值:true-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).STORE_DATA_AT_DELETE}">true</prop><!-- org.hibernate.envers.store_data_at_delete 配置是否在删除操作时,只保存id值还是全部的值。 默认值:false 只记录id-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).DEFAULT_SCHEMA}"></prop><!-- org.hibernate.envers.default_schema 配置数据修改记录表的schema 默认值:null-->
<prop key="#{T(org.hibernate.envers.configuration.EnversSettings).DEFAULT_CATALOG}"></prop><!-- org.hibernate.envers.default_catalog 配置数据修改记录表的catalog 默认值:null-->
</props>
</property>
</bean>
<!-- Spring Data Jpa配置, 扫描base-package下所有继承于Repository<T,ID>的接口 -->
<jpa:repositories base-package="net.gelif.ems.**.dao.**" repository-impl-postfix="Impl" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="jpaTransactionManager"/>
<!-- 事务管理器配置, Jpa单数据源事务 -->
<bean id="jpaTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="jpaTransactionManager" proxy-target-class="true"/>
当我从实体中删除 hibernate envers 设置和 @Audit 时,这些警告消失了。
我认为这些消息是由 ModelBinder 中的错误引起的。而不是 getName 应该是 getXmlNodeName。我已经报告了这个问题,我希望这将在下一个版本中得到修复。无论如何,除了额外的日志行,没有任何其他后果。
此问题已在此处发布的新休眠版本中修复:http://in.relation.to/2015/09/30/hibernate-orm-502-final-release/。 参见 https://hibernate.atlassian.net/browse/HHH-10115 升级后问题应该解决了。