org.hibernate.cfg.Configuration.getProperties()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(231)

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

Configuration.getProperties介绍

[英]Get all properties
[中]获取所有属性

代码示例

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

@Override
protected void configure(Configuration configuration) {
  Properties properties = configuration.getProperties();
  properties.put( "hibernate.id.new_generator_mappings", "true" );
}

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

@Override
protected void configure(Configuration configuration) {
  configuration.getProperties().put(
      org.hibernate.cfg.AvailableSettings.CONNECTION_PROVIDER,
      connectionProvider
  );
  configuration.getProperties().put( AvailableSettings.CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT, Boolean.TRUE );
  configuration.getProperties().put( "hibernate.hikari.autoCommit", Boolean.FALSE.toString() );
}

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

@Override
protected void configure(Configuration configuration) {
  configuration.getProperties().put( AvailableSettings.CONNECTION_PROVIDER, connectionProvider );
  configuration.getProperties().put( AvailableSettings.CONNECTION_PROVIDER_DISABLES_AUTOCOMMIT, Boolean.TRUE );
  configuration.getProperties().put( AvailableSettings.AUTOCOMMIT, Boolean.FALSE.toString() );
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.CREATE_EMPTY_COMPOSITES_ENABLED, "true" );
  configuration.getProperties().put( Environment.USE_SECOND_LEVEL_CACHE, "true" );
  configuration.getProperties().put( Environment.DEFAULT_CACHE_CONCURRENCY_STRATEGY, AccessType.READ_WRITE.getExternalName() );
  configuration.getProperties().put( Environment.USE_QUERY_CACHE, "true" );
  configuration.getProperties().put( Environment.GENERATE_STATISTICS, "true" );
  configuration.getProperties().put( Environment.CACHE_REGION_PREFIX, "" );
  configuration.getProperties().put( "javax.persistence.sharedCache.mode", SharedCacheMode.ALL );
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.CREATE_EMPTY_COMPOSITES_ENABLED, "true" );
  configuration.getProperties().put( Environment.USE_SECOND_LEVEL_CACHE, "false" );
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.CREATE_EMPTY_COMPOSITES_ENABLED, "true" );
  configuration.getProperties().put( Environment.USE_SECOND_LEVEL_CACHE, "false" );
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.CREATE_EMPTY_COMPOSITES_ENABLED, "true" );
  configuration.getProperties().put( Environment.USE_SECOND_LEVEL_CACHE, "false" );
}

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

@Override
protected void configure(Configuration configuration) {
  Properties properties = configuration.getProperties();
  properties.put(CONNECTION_PROVIDER, ViburDBCPConnectionProvider.class);
  properties.put(SHOW_SQL, Boolean.TRUE);
  properties.put(FORMAT_SQL, Boolean.TRUE);
  properties.put("hibernate.vibur.poolInitialSize", "1");
  properties.put("hibernate.vibur.poolMaxSize", Integer.toString(poolMaxSize));
  properties.put("hibernate.vibur.logQueryExecutionLongerThanMs", "100");
  properties.put("hibernate.vibur.statementCacheMaxSize", Integer.toString(statementCacheMaxSize));
}

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

@Override
  protected void configure(Configuration configuration) {
    super.configure( configuration );
    configuration.getProperties().put( Environment.BATCH_FETCH_STYLE, BatchFetchStyle.DYNAMIC );
  }
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.STATEMENT_INSPECTOR, mostRecentStatementInspector );
}

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

@Override
public void configure(Configuration cfg) {
  super.configure( cfg );
  if( SQLServerDialect.class.isAssignableFrom( DIALECT.getClass() )) {
    cfg.getProperties().put( AvailableSettings.CONNECTION_PROVIDER, connectionProvider );
  }
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.CREATE_EMPTY_COMPOSITES_ENABLED, Boolean.valueOf( false ) );
}

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

@Override
protected void configure(Configuration configuration) {
  super.configure( configuration );
  configuration.getProperties().put( Environment.STATEMENT_INSPECTOR, statementInspector );
}

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

@Override
public void configure(Configuration cfg) {
  super.configure( cfg );
  if( SQLServerDialect.class.isAssignableFrom( DIALECT.getClass() )) {
    cfg.getProperties().put( AvailableSettings.CONNECTION_PROVIDER, new SQLServerSnapshotIsolationConnectionProvider() );
  }
}

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

@Before
public void buildSessionFactory() {
  Configuration cfg = new Configuration()
      .addAnnotatedClass( TheEntity.class );
  cfg.getProperties().put( AvailableSettings.DIALECT, NoTupleSupportDialect.class.getName() );
  cfg.getProperties().put( AvailableSettings.HBM2DDL_AUTO, "create-drop" );
  sessionFactory = cfg.buildSessionFactory();
}

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

@Before
public void setup(){
  cfg=new Configuration();
  Properties p = new Properties();
  p.put( Environment.DIALECT, "org.hibernate.dialect.HSQLDialect" );
  p.put( "hibernate.connection.driver_class", "org.h2.Driver" );
  p.put( "hibernate.connection.url", "jdbc:h2:mem:" );
  p.put( "hibernate.connection.username", "sa" );
  p.put( "hibernate.connection.password", "" );
  cfg.setProperties(p);
  serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( cfg.getProperties() );
}

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

@Override
public void configure(Configuration cfg) {
  super.configure( cfg );
  TestingJtaBootstrap.prepare( cfg.getProperties() );
  cfg.setProperty(
      AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY,
      JdbcResourceLocalTransactionCoordinatorBuilderImpl.class.getName()
  );
}

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

@BeforeClass
public static void buildSessionFactory() {
  Configuration cfg = new Configuration();
  cfg.setProperty( AvailableSettings.DIALECT, DIALECT.getClass().getName() );
  ServiceRegistry serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry( cfg.getProperties() );
  SESSION_FACTORY = (SessionFactoryImplementor) cfg.buildSessionFactory( serviceRegistry );
}

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

protected void configure(Configuration cfg) {
  super.configure( cfg );
  cfg.setProperty( Environment.ENABLE_LAZY_LOAD_NO_TRANS, "true" );
  TestingJtaBootstrap.prepare( cfg.getProperties() );
  cfg.setProperty( AvailableSettings.JTA_PLATFORM, "Atomikos" );
}

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

protected void configure(Configuration cfg) {
  super.configure( cfg );
  cfg.setProperty( Environment.ENABLE_LAZY_LOAD_NO_TRANS, "true" );
  TestingJtaBootstrap.prepare( cfg.getProperties() );
  cfg.setProperty( Environment.TRANSACTION_COORDINATOR_STRATEGY, "jta" );
}

相关文章

Configuration类方法