Package org.hibernate.tool.hbm2ddl

Examples of org.hibernate.tool.hbm2ddl.SchemaExport$NamedReader


  @Override
  protected void setUp() throws Exception {
    super.setUp();
    injector = Guice.createInjector(new HibernateModule(), new SimpleModule("javango.polls.Settings"));   
    Configuration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);
    c = new Client(injector);
  }
View Full Code Here


 
  public void testIteratorNoResults() throws Exception {   
    Injector injector = Guice.createInjector(new HibernateModule());

    Configuration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);

    Managers managers = injector.getInstance(Managers.class);

    QuerySet<Poll> pollQs = managers.forClass(Poll.class).all();
    for (Poll p : pollQs) {
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    injector = Guice.createInjector(new HibernateModule());   
    AnnotationConfiguration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();   
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);
    fields = injector.getInstance(FieldFactory.class);
    models = injector.getInstance(ModelFactory.class);
    managers = injector.getInstance(Managers.class);
    hibernateUtil = injector.getInstance(HibernateUtil.class);
  }
View Full Code Here

     * @throws EvolizerException
     */
    public void createSchema(Properties properties) throws EvolizerException {
        try {
            Configuration configuration = configureDataBaseConnection(properties);
            SchemaExport exporter = new SchemaExport(configuration);
            exporter.create(false, true);
        } catch (HibernateException he) {
            throw new EvolizerException(he);
        }
    }
View Full Code Here

     * @throws EvolizerException
     */
    public void dropSchema(Properties properties) throws EvolizerException {
        try {
            Configuration configuration = configureDataBaseConnection(properties);
            SchemaExport exporter = new SchemaExport(configuration);
            exporter.drop(false, true);
        } catch (HibernateException he) {
            throw new EvolizerException(he);
        }
    }
View Full Code Here

              SchemaUpdate update = new SchemaUpdate(configuration, settings);
              update.execute(true, exec);
          }
          else
          {
              SchemaExport export = exec ? new SchemaExport(configuration, settings) :
                      new SchemaExport(configuration);
              export.create(true, exec);
          }
    }
    catch (Exception e) {
      log.error("Error running SchemaTool", e);
      throw e;
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

        properties
    );


    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

    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

TOP

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

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.