Package com.dotcms.repackage.net.sf.hibernate.tool.hbm2ddl

Examples of com.dotcms.repackage.net.sf.hibernate.tool.hbm2ddl.SchemaExport


      }else if(dialect.equals("com.dotcms.repackage.net.sf.hibernate.dialect.HSQLDialect")) {
          cfg.setProperty("hibernate.connection.driver_class", "org.h2.Driver");
          cfg.addResource("com/dotmarketing/beans/DotCMSId.hbm.xml");
      }

            SchemaExport sexp = new SchemaExport(cfg);
      sexp.setDelimiter(";");
      //DOTCMS-2915
      String basedir = this.getProject().getProperties().get("basedir").toString();
            File in = new File(basedir, "sql/sql.tmp");
      String[] x = dialect.split("[.]");
      String sqlFileName = ("sql/cms/dotcms_" + x[x.length - 1].replaceAll("Dialect", "") + ".sql").toLowerCase();
      sqlFileName = sqlFileName.replaceAll("sybase", "mssql-sybase").replaceAll("hsql", "h2");
            Logger.info(this, "writing file:" + sqlFileName);
            //DOTCMS-2915
            //File out = new File(sqlFileName);
            File out = new File(basedir, sqlFileName);
           
      boolean afterDrops = false;
      sexp.setOutputFile(in.getAbsolutePath());
      sexp.create(false, false);
      BufferedReader r = new BufferedReader(new FileReader(in));
      BufferedWriter wr = new BufferedWriter(new FileWriter(out));
      java.util.regex.Pattern p = java.util.regex.Pattern.compile("[a-zA-Z][A-Z,a-z,0-9]*\\s[A-Z,a-z,0-9]*\\s[a-zA-Z][A-Z,a-z,0-9]*\\s\\([a-zA-Z][A-Z,a-z,0-9]*.*");
      while (r.ready()) {
        String myLine = r.readLine().toLowerCase();
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.net.sf.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.