Package org.hibernate.tool.hbm2ddl

Examples of org.hibernate.tool.hbm2ddl.SchemaExport


    if ( debugEnabled ) {
      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


  public void setProperty(String property, String value) {
    properties.setProperty(property, value);
  }

  public void dropSchema() {
    new SchemaExport( buildConfiguration() ).drop(false, true);
  }
View Full Code Here

  public void dropSchema() {
    new SchemaExport( buildConfiguration() ).drop(false, true);
  }

  public void createSchema() {
    new SchemaExport( buildConfiguration() ).create(false, true);
  public String getName() {
View Full Code Here

  public void setProperty(String property, String value) {
    properties.setProperty(property, value);
  }

  public void dropSchema() {
    new SchemaExport( buildConfiguration() ).drop(false, true);
  }
View Full Code Here

  public void dropSchema() {
    new SchemaExport( buildConfiguration() ).drop(false, true);
  }

  public void createSchema() {
    new SchemaExport( buildConfiguration() ).create(false, true);
  public String getName() {
View Full Code Here

  protected boolean recreateSchema() {
    return true;
  }

  protected void runSchemaGeneration() {
    SchemaExport export = new SchemaExport( cfg );
    export.create( true, true );
  }
View Full Code Here

    SchemaExport export = new SchemaExport( cfg );
    export.create( true, true );
  }

  protected void runSchemaDrop() {
    SchemaExport export = new SchemaExport( cfg );
    export.drop( true, true );
  }
View Full Code Here

    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

    } else {
      ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
      builder.applySettings(configuration.getProperties());
      ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
      serviceRegistry.getService( JdbcServices.class );
      SchemaExport export = new SchemaExport(serviceRegistry, configuration);
      if (null != outputFileName) {
        export.setOutputFile(new File(getOutputDirectory(),
            outputFileName).toString());
      }
      if (null != delimiter) {
        export.setDelimiter(delimiter);
      }
      export.setHaltOnError(haltOnError);
      export.setFormat(format);
      if (drop && create) {
        // not just drop or create but both!
        export.execute(scriptToConsole, exportToDatabase, false, false);
      } else {
        export.execute(scriptToConsole, exportToDatabase, drop, create);
      }
    }
   
  }
View Full Code Here

  protected boolean recreateSchema() {
    return true;
  }

  protected void runSchemaGeneration() {
    SchemaExport export = new SchemaExport( cfg );
    export.create( true, true );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.tool.hbm2ddl.SchemaExport

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.