org.hibernate.boot.MetadataBuilder.enableNewIdentifierGeneratorSupport()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中org.hibernate.boot.MetadataBuilder.enableNewIdentifierGeneratorSupport()方法的一些代码示例,展示了MetadataBuilder.enableNewIdentifierGeneratorSupport()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetadataBuilder.enableNewIdentifierGeneratorSupport()方法的具体详情如下:
包路径:org.hibernate.boot.MetadataBuilder
类名称:MetadataBuilder
方法名:enableNewIdentifierGeneratorSupport

MetadataBuilder.enableNewIdentifierGeneratorSupport介绍

[英]Should we enable support for the "new" (since 3.2) identifier generator mappings for handling:

  • javax.persistence.GenerationType#SEQUENCE
  • javax.persistence.GenerationType#IDENTITY
  • javax.persistence.GenerationType#TABLE
  • javax.persistence.GenerationType#AUTO

Its default is defined by the org.hibernate.cfg.AvailableSettings#USE_NEW_ID_GENERATOR_MAPPINGSsetting if using property-based configuration.
[中]我们是否应该支持“新的”(自3.2版起)标识符生成器映射来处理:
*javax。坚持不懈生成类型#序列
*javax。坚持不懈世代类型#身份
*javax。坚持不懈生成类型#表
*javax。坚持不懈生成类型#自动
其默认值由组织定义。冬眠cfg。可用设置#如果使用基于属性的配置,请使用_NEW_ID_GENERATOR_Mappings设置。

代码示例

代码示例来源:origin: hibernate/hibernate-orm

protected void initialize(MetadataBuilder metadataBuilder) {
  metadataBuilder.enableNewIdentifierGeneratorSupport( true );
  metadataBuilder.applyImplicitNamingStrategy( ImplicitNamingStrategyLegacyJpaImpl.INSTANCE );
}

代码示例来源:origin: liquibase/liquibase-hibernate

protected void configureNewIdentifierGeneratorSupport(String value, MetadataBuilder builder) throws DatabaseException {
  String _value;
  _value = getHibernateConnection().getProperties().getProperty(AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, value);
  try {
    if (_value != null) {
      builder.enableNewIdentifierGeneratorSupport(Boolean.valueOf(_value));
    }
  } catch (Exception e) {
    throw new DatabaseException(e);
  }
}

代码示例来源:origin: hibernate/hibernate-ogm

@Override
  public void contribute(MetadataBuilder metadataBuilder, StandardServiceRegistry serviceRegistry) {
    if ( !serviceRegistry.getService( OgmConfigurationService.class ).isOgmEnabled() ) {
      return;
    }

    metadataBuilder.applyImplicitNamingStrategy( new OgmImplicitNamingStrategy() );

    boolean isUseNewGeneratorMappingsConfigured = serviceRegistry.getService( ConfigurationService.class )
        .getSettings()
        .containsKey( AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS );

    if ( !isUseNewGeneratorMappingsConfigured ) {
      metadataBuilder.enableNewIdentifierGeneratorSupport( true );
    }
  }
}

代码示例来源:origin: vladmihalcea/high-performance-java-persistence

metadataBuilder.enableNewIdentifierGeneratorSupport(true);
metadataBuilder.applyImplicitNamingStrategy(ImplicitNamingStrategyLegacyJpaImpl.INSTANCE);

相关文章