Package org.hibernate.tool.hbm2ddl

Examples of org.hibernate.tool.hbm2ddl.SchemaExport.create()


    return true;
  }

  protected void runSchemaGeneration() {
    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


  public void testSchemaToolsNonQuote() throws Exception{
    // database schema have been created thanks to the setUp method
    // we have 2 schemas SA et SB, SB must be set as the default schema
    // used by hibernate hibernate.default_schema SB
    SchemaExport se = new SchemaExport(getCfg());
    se.create(true,true);
   
    // here we modify the generated table in order to test SchemaUpdate
    Session session = openSession();
    Connection conn = session.connection();
    Statement stat = conn.createStatement();
View Full Code Here

  public void testFailingQuoteValidation() throws Exception{
    // database schema have been created thanks to the setUp method
    // we have 2 schemas SA et SB, SB must be set as the default schema
    // used by hibernate hibernate.default_schema SB
    SchemaExport se = new SchemaExport(getCfg());
    se.create(true,true);
   
    // here we modify the generated table in order to test SchemaUpdate
    Session session = openSession();
    Connection conn = session.connection();
    Statement stat = conn.createStatement();
View Full Code Here

  public void testFailingNonQuoteValidation() throws Exception{
    // database schema have been created thanks to the setUp method
    // we have 2 schemas SA et SB, SB must be set as the default schema
    // used by hibernate hibernate.default_schema SB
    SchemaExport se = new SchemaExport(getCfg());
    se.create(true,true);
   
    // here we modify the generated table in order to test SchemaUpdate
    Session session = openSession();
    Connection conn = session.connection();
    Statement stat = conn.createStatement();
View Full Code Here

  public void testSchemaTools() throws Exception{
    // database schema have been created thanks to the setUp method
    // we have 2 schemas SA et SB, SB must be set as the default schema
    // used by hibernate hibernate.default_schema SB
    SchemaExport se = new SchemaExport(getCfg());
    se.create(true,true);
   
    // here we modify the generated table in order to test SchemaUpdate
    Session session = openSession();
    Connection conn = session.connection();
    Statement stat = conn.createStatement();
View Full Code Here

    Session session = (Session)em.getDelegate();
    session.doWork(new Work() {
      @Override
      public void execute(Connection connection) throws SQLException {
        SchemaExport export = new SchemaExport(conf, connection);
        export.create(true, true);
      }
    });
   
    em.close();
  }
View Full Code Here

  }

  protected void runSchemaGeneration() {
    if ( recreateSchema() ) {
      SchemaExport export = new SchemaExport( cfg );
      export.create( true, true );
    }
  }

  protected void runSchemaDrop() {
    if ( recreateSchema() ) {
View Full Code Here

    public static void main(String[] args) {
        Configuration c = new AnnotationConfiguration().configure();
        SchemaExport export = new SchemaExport(c);
        export.setDelimiter(";");
        export.setOutputFile("sql-out.sql");
        export.create(false, false);
    }
}
View Full Code Here

    private static void GerarTabelas() {
        AnnotationConfiguration cfg = new AnnotationConfiguration();
        cfg.configure("hibernate.cfg.xml");
        SchemaExport sx = new SchemaExport(cfg);
        sx.create(true, true);
    }

    private static void excluindo() {
    }
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.