Package org.hibernate.cfg

Examples of org.hibernate.cfg.Settings


    assertEquals(new TableIdentifier(null, SCHEMA, TABLE1), childid);
    assertEquals(new TableIdentifier(null, SCHEMA, TABLE2), masterid);
  }
 
  public void testNeedQuote() {
    Settings buildSettings = cfg.buildSettings();
    ServiceRegistry serviceRegistry = cfg.getServiceRegistry();
       
    MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( serviceRegistry.getService(JdbcServices.class).getDialect(), cfg.getProperties() );
    assertTrue("The name must be quoted!", realMetaData.needQuote(SCHEMA));
    assertTrue("The name must be quoted!", realMetaData.needQuote(TABLE1));
View Full Code Here


   * but getTable uses non-quoted names )
   */
  public void testQuotedNamesAndDefaultDatabaseCollector() {
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    ServiceRegistry serviceRegistry = builder.build();
    Settings buildSettings = cfg.buildSettings(serviceRegistry);
       
    MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( serviceRegistry.getService(JdbcServices.class).getDialect(), cfg.getProperties() );
   
    JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, new DefaultReverseEngineeringStrategy(), realMetaData, serviceRegistry );
   
View Full Code Here

   
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    builder.applySettings(configuration.getProperties());
    ServiceRegistry serviceRegistry = builder.build();
   
    Settings testSettings = configuration.buildSettings(serviceRegistry);
   
    JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
    Connection con = null;
        try {
   
    con = jdbcServices.getConnectionProvider().getConnection();
   
    JDBCMetaDataDialect dialect = new JDBCMetaDataDialect();
   
    dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(jdbcServices.getConnectionProvider(), jdbcServices.getSqlExceptionHelper().getSqlExceptionConverter(), new DefaultDatabaseCollector(dialect)));
    Iterator tables = dialect.getTables( testSettings.getDefaultCatalogName(), testSettings.getDefaultSchemaName(), null );
   
    assertHasNext( 0, tables );
        } finally {
          jdbcServices.getConnectionProvider().closeConnection(con)
        }
View Full Code Here

  public void testReadSchemaIncremental() {
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    builder.applySettings(cfg.getProperties());
    ServiceRegistry serviceRegistry = builder.build();

    Settings buildSettings = cfg.buildSettings(serviceRegistry);

    TableSelectorStrategy tss = new TableSelectorStrategy(new DefaultReverseEngineeringStrategy());
    MockedMetaDataDialect mockedMetaDataDialect = new MockedMetaDataDialect();
    JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, tss, mockedMetaDataDialect, serviceRegistry);
   
View Full Code Here

 
  public void testCachedDialect() {
   
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    ServiceRegistry serviceRegistry = builder.build();
    Settings buildSettings = cfg.buildSettings(serviceRegistry);
       
    MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( serviceRegistry.getService(JdbcServices.class).getDialect(), cfg.getProperties() );
   
    MockedMetaDataDialect mock = new MockedMetaDataDialect(realMetaData);
    CachedMetaDataDialect dialect = new CachedMetaDataDialect(mock);
View Full Code Here

  }

  protected void tearDown() throws Exception {
    Statement statement = null;
    Connection con = null;
    Settings settings = null;
    ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
      .applySettings( getConfiguration().getProperties() )
      .build();
     
        try {
View Full Code Here

 
    MetaDataDialect dialect = new JDBCMetaDataDialect();
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    ServiceRegistry serviceRegistry = builder.build();
    JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
    Settings settings = cfg.buildSettings(serviceRegistry);
   
    dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(jdbcServices.getConnectionProvider(),
        jdbcServices.getSqlExceptionHelper().getSqlExceptionConverter(), new DefaultDatabaseCollector(dialect)));
   
    Iterator tables = dialect.getTables( settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), identifier("tab_master") );
   
    boolean foundMaster = false;
    while(tables.hasNext()) {
      Map map = (Map) tables.next();
     
View Full Code Here

   
    MetaDataDialect dialect = new JDBCMetaDataDialect();
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    ServiceRegistry serviceRegistry = builder.build();
    JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
    Settings settings = cfg.buildSettings(serviceRegistry);
   
    dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(jdbcServices.getConnectionProvider(),
        jdbcServices.getSqlExceptionHelper().getSqlExceptionConverter(), new DefaultDatabaseCollector(dialect)));
   
    Iterator tables = dialect.getColumns( settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), "test", null );
   
   
    while(tables.hasNext()) {
      Map map = (Map) tables.next();
     
View Full Code Here

 
    MetaDataDialect dialect = new JDBCMetaDataDialect();
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    ServiceRegistry serviceRegistry = builder.build();
    JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
    Settings settings = cfg.buildSettings(serviceRegistry);
   
    dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(jdbcServices.getConnectionProvider(),
        jdbcServices.getSqlExceptionHelper().getSqlExceptionConverter(), new DefaultDatabaseCollector(dialect)));
   
    Iterator tables = dialect.getTables( settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), identifier( "TAB_MASTER"));
   
    assertHasNext( 1,  tables );
   
   
   
View Full Code Here

    private boolean flushBeforeCompletion;
    private String tenantIdentifier;

    SessionBuilderImpl(SessionFactoryImpl sessionFactory) {
      this.sessionFactory = sessionFactory;
      final Settings settings = sessionFactory.settings;

      // set up default builder values...
      this.interceptor = sessionFactory.getInterceptor();
      this.connectionReleaseMode = settings.getConnectionReleaseMode();
      this.autoClose = settings.isAutoCloseSessionEnabled();
      this.flushBeforeCompletion = settings.isFlushBeforeCompletionEnabled();
    }
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.Settings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.