Package org.objectstyle.wolips.eomodeler.core.sql

Examples of org.objectstyle.wolips.eomodeler.core.sql.IEOSQLGenerator


        public void run() {
          getShell().setCursor(getWaitCursor());
          getExecuteSqlButton().setEnabled(false);
        }
      });
      IEOSQLGenerator sqlGenerator = IEOSQLGeneratorFactory.Utility.sqlGeneratorFactory().sqlGenerator(_model, getEntityNames(), selectedDatabaseConfig, getEOModelClassLoader(), runInEntityModeler);
      final String sqlScript = sqlGenerator.generateSchemaCreationScript(flags);
      Display.getDefault().syncExec(new Runnable() {
        public void run() {
          getSqlText().setText(sqlScript);
          getExecuteSqlButton().setEnabled(true);
        }
View Full Code Here


      Display.getDefault().syncExec(new Runnable() {
        public void run() {
          getShell().setCursor(getWaitCursor());
        }
      });
      IEOSQLGenerator sqlGenerator = IEOSQLGeneratorFactory.Utility.sqlGeneratorFactory().sqlGenerator(_model, getEntityNames(), selectedDatabaseConfig, getEOModelClassLoader(), runInEntityModeler);
      String url = selectedDatabaseConfig.getURL();
      char commandSeparatorChar;
      // yes. This sucks.
      if (url != null && url.toLowerCase().contains("oracle")) {
        commandSeparatorChar = '/';
      } else {
        commandSeparatorChar = ';';
      }
      List<String> statements = SQLUtils.splitSQLStatements(allSql, commandSeparatorChar);
      setCancel(false);
      for (int statementsNum = 0; !_cancel && statementsNum < statements.size(); statementsNum++) {
        String statement = statements.get(statementsNum);
        statement = statement.trim().replaceAll("[\n\r]", " ");
        if (statement.length() > 0) {
          try {
            sqlGenerator.executeSQL(statement);
          } catch (final Throwable t) {
            Display.getDefault().syncExec(new Runnable() {
              public void run() {
                MessageDialog dialog = new MessageDialog(getShell(), "Error", null, StringUtils.getErrorMessage(t) + "\n\nThere was an error, do you want to cancel the rest of the script?", MessageDialog.QUESTION, new String[] { "Cancel", "Continue" }, 0);
                int results = dialog.open();
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.eomodeler.core.sql.IEOSQLGenerator

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.