Package org.hibernate.tool.hbm2ddl

Examples of org.hibernate.tool.hbm2ddl.SchemaExport


  }
 
  public void testMultipleJoins() throws Exception {
      Injector injector = Guice.createInjector(new HibernateModule());
    AnnotationConfiguration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();   
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);
   
      Managers managers = injector.getInstance(Managers.class);     
     
      User user = new User();
      user.setName("joe smith");
View Full Code Here


  }
 
  public void testJoinedOrderBy() throws Exception {
      Injector injector = Guice.createInjector(new HibernateModule());
    AnnotationConfiguration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();   
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);
   
      Managers managers = injector.getInstance(Managers.class);     
     
      User user = new User();
      user.setName("joe smith");
View Full Code Here

  }
 
  public void testDistinctEntry() throws Exception {
      Injector injector = Guice.createInjector(new HibernateModule());
    AnnotationConfiguration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();   
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);
   
      Managers managers = injector.getInstance(Managers.class);     
     
      User user = new User();
      user.setName("joe smith");
View Full Code Here

  }

  public void testInSet() throws Exception {
    Injector injector = Guice.createInjector(new HibernateModule());
    AnnotationConfiguration cfg = injector.getInstance(HibernateUtil.class).getConfiguration();   
    new SchemaExport(cfg).drop(false, true);
    new SchemaExport(cfg).create(false, true);
   
    Managers managers = injector.getInstance(Managers.class);     
     
      User user = new User();
      user.setName("joe smith");
View Full Code Here

public class IntensionExporter {
  private IntensionExporter() {}

  public static void main(String args[]) {
    Configuration configuration;
    SchemaExport exporter;
   
    configuration = new Configuration();
    configuration.setProperty("hibernate.dialect", args[0]);
        configuration.configure();   
    exporter = new SchemaExport(configuration);
    exporter.create(true, false);
  }
View Full Code Here

    SessionFactoryObjectFactory.addInstance(uuid, name, this, properties);

        LOG.debugf("Instantiated session factory");

    if ( settings.isAutoCreateSchema() ) {
      new SchemaExport( serviceRegistry, cfg ).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 );
    }

    currentSessionContext = buildCurrentSessionContext();

    if ( settings.isQueryCacheEnabled() ) {
View Full Code Here

        Properties props = new Properties();
        props.load(new FileInputStream(hibernateProperties));
        Configuration cfg = new AnnotationConfiguration().configure(hibernateCfgXml);
        cfg.setProperties(props);
            getLog().info("Dropping all database tables.");
      new SchemaExport(cfg).drop(false, true);
      getLog().info("Done,  creating all database tables.");
      new SchemaExport(cfg).create(false, true);
      getLog().info("Done.");
      } catch (Exception e) {
        throw new MojoExecutionException(e.getMessage());
      }
    }
View Full Code Here

  }
 
  public HttpResponse resetdb(HttpRequest request) {
    if ("POST".equals(request.getMethod())) {
      Configuration cfg = hibernateUtil.getConfiguration();
      new SchemaExport(cfg).drop(false, true);
      new SchemaExport(cfg).create(false, true);
      request.getSession().addMessage("Tables created successfully");
      return new HttpResponseRedirect("..");
    }
   
    Map<String, Object> context = new HashMap<String, Object>();
View Full Code Here

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    injector = new javango.polls.Settings().createInjector(null);   
    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

    List<Module> modules = new ArrayList<Module>();
    modules.add(new HibernateModule());
    injector = new javango.contrib.admin.tests.AdminTestSettings().createInjector(modules);
   
    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

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.