Examples of SchemaExport


Examples of org.hibernate.tool.hbm2ddl.SchemaExport

  public static Configuration getConfiguration(SessionFactory sessionFactory) {
    return (Configuration) configurations.get(sessionFactory);
  }

  public static SchemaExport createSchemaExport(SessionFactory sessionFactory) {
    return new SchemaExport(getConfiguration(sessionFactory));
  }
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    List<? extends Exception> exceptions;
    try {
      Configuration configuration = getConfiguration();
      if ("drop".equalsIgnoreCase(action)) {
        SchemaExport schemaExport = getSchemaExport(configuration);
        schemaExport.drop(false, false);
        exceptions = CollectionUtil.checkList(schemaExport.getExceptions(), Exception.class);
      }
      else if ("create".equalsIgnoreCase(action)) {
        SchemaExport schemaExport = getSchemaExport(configuration);
        schemaExport.execute(false, false, false, true);
        exceptions = CollectionUtil.checkList(schemaExport.getExceptions(), Exception.class);
      }
      else if ("update".equalsIgnoreCase(action)) {
        JbpmSchemaUpdate schemaUpdate = getSchemaUpdate(configuration);
        schemaUpdate.execute(false, false);
        exceptions = schemaUpdate.getExceptions();
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    }
    return configuration;
  }

  private SchemaExport getSchemaExport(Configuration configuration) {
    SchemaExport schemaExport = new SchemaExport(configuration);

    if (output != null)
      schemaExport.setOutputFile(output);

    if (delimiter != null)
      schemaExport.setDelimiter(delimiter);

    schemaExport.setFormat(false);
    return schemaExport;
  }
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

  public synchronized SchemaExport getSchemaExport()
  {
    if (schemaExport == null)
    {
      log.debug("creating schema export");
      schemaExport = new SchemaExport(getConfiguration());
    }
    return schemaExport;
  }
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    );

    LOG.debug( "Instantiated session factory" );

    if ( settings.isAutoCreateSchema() ) {
      new SchemaExport( serviceRegistry, cfg )
          .setImportSqlCommandExtractor( serviceRegistry.getService( ImportSqlCommandExtractor.class ) )
          .create( false, true );
    }
    if ( settings.isAutoUpdateSchema() ) {
      new SchemaUpdate( serviceRegistry, cfg ).execute( false, true );
    }
    if ( settings.isAutoValidateSchema() ) {
      new SchemaValidator( serviceRegistry, cfg ).validate();
    }
    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( serviceRegistry, cfg )
          .setImportSqlCommandExtractor( serviceRegistry.getService( ImportSqlCommandExtractor.class ) );
    }

    currentSessionContext = buildCurrentSessionContext();
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    );

    LOG.debug("Instantiated session factory");

    if ( settings.isAutoCreateSchema() ) {
      new SchemaExport( metadata )
          .setImportSqlCommandExtractor( serviceRegistry.getService( ImportSqlCommandExtractor.class ) )
          .create( false, true );
    }

    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( metadata )
          .setImportSqlCommandExtractor( serviceRegistry.getService( ImportSqlCommandExtractor.class ) );
    }

    currentSessionContext = buildCurrentSessionContext();
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    SessionFactoryObjectFactory.addInstance(uuid, name, this, properties);

    log.debug("instantiated session factory");

    if ( settings.isAutoCreateSchema() ) {
      new SchemaExport( cfg, settings ).create( false, true );
    }
    if ( settings.isAutoUpdateSchema() ) {
      new SchemaUpdate( cfg, settings ).execute( false, true );
    }
    if ( settings.isAutoValidateSchema() ) {
      new SchemaValidator( cfg, settings ).validate();
    }
    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( cfg, settings );
    }

    if ( settings.getTransactionManagerLookup()!=null ) {
      log.debug("obtaining JTA TransactionManager");
      transactionManager = settings.getTransactionManagerLookup().getTransactionManager(properties);
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    SessionFactoryObjectFactory.addInstance(uuid, name, this, properties);

    log.debug("instantiated session factory");

    if ( settings.isAutoCreateSchema() ) {
      new SchemaExport( cfg, settings ).create( false, true );
    }
    if ( settings.isAutoUpdateSchema() ) {
      new SchemaUpdate( cfg, settings ).execute( false, true );
    }
    if ( settings.isAutoValidateSchema() ) {
      new SchemaValidator( cfg, settings ).validate();
    }
    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( cfg, settings );
    }

    if ( settings.getTransactionManagerLookup()!=null ) {
      log.debug("obtaining JTA TransactionManager");
      transactionManager = settings.getTransactionManagerLookup().getTransactionManager(properties);
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    SessionFactoryObjectFactory.addInstance(uuid, name, this, properties);

    log.debug("instantiated session factory");

    if ( settings.isAutoCreateSchema() ) {
      new SchemaExport( cfg, settings ).create( false, true );
    }
    if ( settings.isAutoUpdateSchema() ) {
      new SchemaUpdate( cfg, settings ).execute( false, true );
    }
    if ( settings.isAutoValidateSchema() ) {
      new SchemaValidator( cfg, settings ).validate();
    }
    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( cfg, settings );
    }

    if ( settings.getTransactionManagerLookup()!=null ) {
      log.debug("obtaining JTA TransactionManager");
      transactionManager = settings.getTransactionManagerLookup().getTransactionManager(properties);
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaExport

    properties.setProperty(property, value);
  }

  @Override
  public void dropSchema() {
    new SchemaExport( buildConfiguration() ).drop(false, true);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.