Package org.hibernate.tool.hbm2ddl

Examples of org.hibernate.tool.hbm2ddl.SchemaExport


    buildSessionFactory( getMappings(), getAnnotatedPackages(), getXmlFiles() );
    ensureIndexesAreEmpty();
  }

  protected void tearDown() throws Exception {
    SchemaExport export = new SchemaExport( cfg );
    export.drop( false, true );
  }
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

    try {
      new File(dir).mkdirs();
      saveSqlScript(dir + "/" + prefix + ".drop.sql", getDropSql());
      saveSqlScript(dir + "/" + prefix + ".create.sql", getCreateSql());
      saveSqlScript(dir + "/" + prefix + ".clean.sql", getCleanSql());
      new SchemaExport(configuration).setDelimiter(getSqlDelimiter()).setOutputFile(dir
          + "/"
          + prefix
          + ".drop.create.sql").create(true, false);
    }
    catch (IOException e) {
View Full Code Here

      throw new BuildException("couldn't create schema.  no jbpm nor hibernate configuration specified.");
    }

    JbpmSchema jbpmSchema = new JbpmSchema(configuration);

    SchemaExport schemaExport = new SchemaExport(configuration);
    if (output!=null) schemaExport.setOutputFile(output);
    if (delimiter!=null) schemaExport.setDelimiter(delimiter);

    StringTokenizer tokenizer = new StringTokenizer(actions, ",");
    while (tokenizer.hasMoreTokens()) {
      String action = tokenizer.nextToken();

      if ("drop".equalsIgnoreCase(action)) {
        schemaExport.drop(!quiet, !text);

      } else if ("create".equalsIgnoreCase(action)) {
        schemaExport.create(!quiet, !text);
       
      } else if ("clean".equalsIgnoreCase(action)) {
        jbpmSchema.cleanSchema();
      }
    }
View Full Code Here

  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

  }

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

  }
 
  protected void tearDown() throws Exception {
    StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
    builder.applySettings(getCfg().getProperties());
    SchemaExport export = new SchemaExport(builder.build(), getCfg());
    export.drop( false, true );
   
    if (export.getExceptions() != null && export.getExceptions().size() > 0){
      fail("Schema export failed");
    }
   
    super.tearDown();
  }
View Full Code Here

        );
        s.delete( puppetInst2 );
        s.getTransaction().commit();
        s.close();
        sf.close();
        new SchemaExport(configuration).drop(false, true);
        
       };
      
    }.run();
   
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

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.