Package org.apache.openjpa.jdbc.schema

Examples of org.apache.openjpa.jdbc.schema.SchemaTool


        throws SQLException {
        if (_log.isInfoEnabled())
            _log.info(_loc.get("drop-seq-table"));

        // drop the table
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.dropTable(_pkColumn.getTable());
    }
View Full Code Here


        throws SQLException {
        if (_log.isInfoEnabled())
            _log.info(_loc.get("make-seq-table"));

        // create the table
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.createTable(_pkColumn.getTable());
    }
View Full Code Here

        throws SQLException {
        if (_log.isInfoEnabled())
            _log.info(_loc.get("drop-seq-table"));

        // drop the table
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.dropTable(_pkColumn.getTable());
    }
View Full Code Here

     * Return the schema tool to use for schema modification.
     */
    private SchemaTool newSchemaTool(String action) {
        if (SCHEMA_ACTION_NONE.equals(action))
            action = null;
        SchemaTool tool = new SchemaTool(_conf, action);
        tool.setIgnoreErrors(getIgnoreErrors());
        tool.setPrimaryKeys(getPrimaryKeys());
        tool.setForeignKeys(getForeignKeys());
        tool.setIndexes(getIndexes());
        tool.setSequences(getSequences());
        return tool;
    }
View Full Code Here

                String[] schemaActions = _schemaActions.split(",");
                for (int i = 0; i < schemaActions.length; i++) {
                    if (!SCHEMA_ACTION_NONE.equals(schemaActions[i])
                        && (_schemaWriter == null || (_schemaTool != null
                            && _schemaTool.getWriter() != null))) {
                        SchemaTool tool = newSchemaTool(schemaActions[i]);

                        // configure the tool with additional settings
                        if (flags != null) {
                            tool.setDropTables(flags.dropTables);
                            tool.setDropSequences(flags.dropSequences);
                            tool.setWriter(flags.sqlWriter);
                            tool.setOpenJPATables(flags.openjpaTables);
                        }

                        tool.setSchemaGroup(getSchemaGroup());
                        tool.run();
                        tool.record();
                    }
                }

                // xml output of schema?
                if (_schemaWriter != null) {
View Full Code Here

        throws SQLException {
        if (_log.isInfoEnabled())
            _log.info(_loc.get("make-seq-table"));

        // create the table
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.createTable(_pkColumn.getTable());
    }
View Full Code Here

        throws SQLException {
        if (_log.isInfoEnabled())
            _log.info(_loc.get("drop-seq-table"));

        // drop the table
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.dropTable(_pkColumn.getTable());
    }
View Full Code Here

        Log log = _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
        if (log.isInfoEnabled())
            log.info(_loc.get("make-native-seq"));

        // create the sequence
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.createSequence(_seq);
    }
View Full Code Here

        Log log = _conf.getLog(OpenJPAConfiguration.LOG_RUNTIME);
        if (log.isInfoEnabled())
            log.info(_loc.get("drop-native-seq"));

        // drop the table
        SchemaTool tool = new SchemaTool(_conf);
        tool.setIgnoreErrors(true);
        tool.dropSequence(_seq);
    }
View Full Code Here

  private static LogImpl getLogImpl(JDBCConfiguration conf) {
    return (LogImpl)conf.getLog(JDBCConfiguration.LOG_SCHEMA);
  }

  private static void runSchemaTool(JDBCConfigurationImpl conf, String action) throws Exception {
    SchemaTool st = new SchemaTool(conf, action);
    st.setIgnoreErrors(true);
    st.setOpenJPATables(true);
    st.setIndexes(false);
    st.setPrimaryKeys(false);
    if (!SchemaTool.ACTION_DROPDB.equals(action)) {
      st.setSchemaGroup(st.getDBSchemaGroup());
    }
    st.run();
  }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.schema.SchemaTool

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.