Examples of generateSchemaCreationScript()


Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

        sb.append(";\n");
      }
      System.out.println("Writing drop script to " + dropScriptFileName);
      new FileOutputStream(dropScriptFileName).write(sb.toString().getBytes());
      // Create create script(s)
      final String[] createScript = hibernateConfiguration.generateSchemaCreationScript(Dialect.getDialect(ejb3Configuration.getProperties()));
      sb = new StringBuilder();
      for (String line : createScript) {
        // Format nicely, so it looks more like the old, manually created ones.
        if (line.startsWith("create")) {
          line = line.replaceAll("create table", "CREATE TABLE");
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
      }
      String expectedSqlPointyTooth = "create table PointyTooth (id numeric(128,0) not null, " +
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
      }
      String expectedSqlPointyTooth = "create table PointyTooth (id numeric(128,0) not null, " +
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

      config.addAnnotatedClass(A.class);
      config.addAnnotatedClass(B.class);
      config.addAnnotatedClass(C.class);
      config.addAnnotatedClass(D.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
      }
      log.debug("success");
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

      config.addAnnotatedClass(ClassA.class);
      config.addAnnotatedClass(ClassB.class);
      config.addAnnotatedClass(ClassC.class);
      config.addAnnotatedClass(ClassD.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new HSQLDialect());
      for (String s : schema) {
        log.debug(s);
      }
      log.debug("success");
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
      }
      String expectedSqlPointyTooth = "create table PointyTooth (id numeric(128,0) not null, " +
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Bunny.class);
      config.addAnnotatedClass(PointyTooth.class);
      config.addAnnotatedClass(TwinkleToes.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
      }
      String expectedSqlPointyTooth = "create table PointyTooth (id numeric(128,0) not null, " +
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

          throw new HibernateException(e);
        }
      } else {
        writer.println("/* full drop-and-create script */");
        printSQL(writer, hibernateConfig.generateDropSchemaScript(settings.getDialect()));
        printSQL(writer, hibernateConfig.generateSchemaCreationScript(settings.getDialect()));
      }
    } catch (HibernateException e) {
      writer.println("Error: unable to connect to the database.\n");
      e.printStackTrace(writer);
    }
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

  @Override
  protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
      throws ServletException, IOException {
    final AnnotationConfiguration c = new AnnotationConfiguration();
    c.configure();
    final String[] ls = c.generateSchemaCreationScript(new PostgreSQLDialect());
    final PrintWriter out = response.getWriter();
    for (final String l : ls) {
      out.println(l + ";");
    }
  }
View Full Code Here

Examples of org.hibernate.cfg.AnnotationConfiguration.generateSchemaCreationScript()

    try {
      AnnotationConfiguration config = new AnnotationConfiguration();
      config.addAnnotatedClass(Address.class);
      config.addAnnotatedClass(Person.class);
      config.buildSessionFactory();
      String[] schema = config
          .generateSchemaCreationScript(new SQLServerDialect());
      for (String s : schema) {
        log.debug(s);
      }
      String expectedMappingTableSql = "create table personAddress (address_id numeric(19,0) null, " +
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.