Examples of generateDropSchemaScript()


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

      // Configure with our current persistence unit
      final Ejb3Configuration ejb3Configuration = new Ejb3Configuration().configure("ejbca-pu", null);
      final AnnotationConfiguration hibernateConfiguration = ejb3Configuration.getHibernateConfiguration();
    try {
      // Create drop script
        final String[] dropScript = hibernateConfiguration.generateDropSchemaScript(Dialect.getDialect(ejb3Configuration.getProperties()));
      StringBuilder sb = new StringBuilder();
      for (String line : dropScript) {
        sb.append(line);
        sb.append(";\n");
      }
View Full Code Here

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

        } catch (SQLException e) {
          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.Configuration.generateDropSchemaScript()

            String[] scriptCreateDdlArray = cfg.generateSchemaCreationScript(dialect);
            List<String> scriptCreateDdlList = Arrays.asList(scriptCreateDdlArray);
            File scriptCreateFile = new File(targetDir, dbName + "-create.sql");
            FileUtils.writeLines(scriptCreateFile, "UTF-8", scriptCreateDdlList, lineEnding);

            String[] scriptDropDdlArray = cfg.generateDropSchemaScript(dialect);
            List<String> scriptDropDdlList = Arrays.asList(scriptDropDdlArray);
            File scriptDropFile = new File(targetDir, dbName + "-drop.sql");
            FileUtils.writeLines(scriptDropFile, "UTF-8", scriptDropDdlList, lineEnding);
        }
    }
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.