Package org.sf.bee.persistence.sql.executors

Examples of org.sf.bee.persistence.sql.executors.AbstractSQLExecutor


     * @param props
     * @throws java.lang.Exception
     */
    public void dropAndCreateDatabase(final String unitName,
            final BeePersistenceProperties props) throws Exception {
        final AbstractSQLExecutor exec = _execfactory.create(props);
        if (null != exec) {
            exec.open();
            try {
                exec.dropDatabase();
                exec.createDatabase();
            } catch (Throwable t) {
                // may be tables doest not exists
            }
            //-- recreate schema tables --//
            this.createTables(unitName, exec.getDatabaseProperties());
        }
    }
View Full Code Here


     * @throws java.lang.Exception
     */
    public SQLCommandResponses synchronizeSchemas(final String unitName,
            final BeePersistenceProperties sourceProps,
            final BeePersistenceProperties targetProps) throws Exception {
        final AbstractSQLExecutor exec = _execfactory.create(sourceProps);
        if (null != exec) {
            exec.setDatabaseProperties(targetProps);
            this.synchronizeSchemas(unitName, exec);
        }
        return null;
    }
View Full Code Here

     * @throws java.lang.Exception
     */
    public SQLCommandResponses synchronizeSchemas(final String unitName,
            final BeePersistenceProperties props)
            throws Exception {
        final AbstractSQLExecutor exec = _execfactory.create(props);
        return this.synchronizeSchemas(unitName, exec);
    }
View Full Code Here

    //                      p r i v a t e
    // ------------------------------------------------------------------------
    private boolean checkDatabaseExists(final BeePersistenceProperties props)
            throws Exception {
        if (null != props && !props.isEmpty()) {
            final AbstractSQLExecutor exec = _execfactory.create(props);
            if (null != exec) {
                if (!exec.existsDatabase()) {
                    exec.createDatabase(exec.getDbName());
                    return false;
                }
            }
        }
        return true;
View Full Code Here

TOP

Related Classes of org.sf.bee.persistence.sql.executors.AbstractSQLExecutor

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.