Package org.hibernate.tool.hbm2ddl

Examples of org.hibernate.tool.hbm2ddl.SchemaUpdate


              }
          }
         
          if (mode == Mode.UPDATE)
          {
              SchemaUpdate update = new SchemaUpdate(configuration, settings);
              update.execute(true, exec);
          }
          else
          {
              SchemaExport export = exec ? new SchemaExport(configuration, settings) :
                      new SchemaExport(configuration);
View Full Code Here


      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() ) {
View Full Code Here

        for (String resource : mappingResources) {
            cfg.addResource(resource);
        } // end for
       
        logger.info("begin database schema creation =========================");
        new SchemaUpdate(cfg).execute(true, true);
        logger.info("end database schema creation ===========================");
    }
View Full Code Here

    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() ) {
View Full Code Here

      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() ) {
View Full Code Here

    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() ) {
View Full Code Here

      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() ) {
View Full Code Here

    Connection conn = session.connection();
    Statement stat = conn.createStatement();
    stat.execute("ALTER TABLE \"SB\".\"Team\" DROP COLUMN name ");
   
    // update schema
    SchemaUpdate su = new SchemaUpdate(getCfg());
    su.execute(true,true);
   
    // we can run schema validation. Note that in the setUp method a *wrong* table
    // has been created with different column names
    // if schema validator chooses the bad db schema, then the testcase will fail (exception)
    SchemaValidator sv = new SchemaValidator(getCfg());
View Full Code Here

    stat.execute("DROP TABLE \"SB\".\"TeamView\" ");
    stat.execute("CREATE VIEW \"SB\".\"TeamView\" AS SELECT \"iD\",name, name as duplicatedname FROM \"SB\".\"Team\"");
   

    // update schema, here should do nothing
    SchemaUpdate su = new SchemaUpdate(getCfg());
    su.execute(true,true);
   
    // we can run schema validation.
    // if schema validator chooses the bad db schema, then the testcase will fail (exception)
    SchemaValidator sv = new SchemaValidator(getCfg());
    sv.validate();
View Full Code Here

    Connection conn = session.connection();
    Statement stat = conn.createStatement();
    stat.execute("ALTER TABLE \"SB\".\"TEAM\" DROP COLUMN xname ");
   
    // update schema
    SchemaUpdate su = new SchemaUpdate(getCfg());
    su.execute(true,true);
   
    // we can run schema validation. Note that in the setUp method a *wrong* table
    // has been created with different column names
    // if schema validator chooses the bad db schema, then the testcase will fail (exception)
    SchemaValidator sv = new SchemaValidator(getCfg());
View Full Code Here

TOP

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

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.