Examples of JDBCFetchConfiguration


Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

                return Collections.singleton(key);
            return Collections.EMPTY_LIST;
        }

        final ClassMapping[] clss = _strat.getIndependentKeyMappings(true);
        final JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        final Joins[] resJoins = new Joins[Math.max(1, clss.length)];

        Union union = store.getSQLFactory().newUnion
            (Math.max(1, clss.length));
        if (fetch.getSubclassFetchMode(_strat.getFieldMapping().
            getKeyMapping().getTypeMapping()) != fetch.EAGER_JOIN)
            union.abortUnion();
        union.select(new Union.Selector() {
            public void select(Select sel, int idx) {
                ClassMapping cls = (clss.length == 0) ? null : clss[idx];
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

            if (hasValue(val))
                return val;
            return null;
        }

        final JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        final ClassMapping[] clss = _strat.getIndependentValueMappings(true);
        final Joins[] resJoins = new Joins[Math.max(1, clss.length)];
        Union union = store.getSQLFactory().newUnion(Math.max(1, clss.length));
        union.setExpectedResultCount(1, false);
        if (fetch.getSubclassFetchMode(_strat.getFieldMapping().
            getElementMapping().getTypeMapping())
            != JDBCFetchConfiguration.EAGER_JOIN)
            union.abortUnion();
        union.select(new Union.Selector() {
            public void select(Select sel, int idx) {
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

    }

    protected Iterator itr() {
        OpenJPAStateManager sm = assertOwner();
        JDBCStore store = getStore();
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        try {
            Joins[] joins = new Joins[2];
            Result[] res = _strat.getResults(sm, store, fetch, fetch.EAGER_JOIN,
                joins, true);
            return new ResultIterator(sm, store, fetch, res, joins);
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

        Select sel = store.getSQLFactory().newSelect();
        sel.select(cols);
        sel.wherePrimaryKey(sm.getObjectId(), vers.getClassMapping(), store);

        // No need to lock version field (i.e. optimistic), except when version update is required (e.g. refresh)
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        if (!updateVersion && fetch.getReadLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) {
            fetch = (JDBCFetchConfiguration) fetch.clone();
            fetch.setReadLockLevel(MixedLockLevels.LOCK_NONE);
        }
        Result res = sel.execute(store, fetch);
        try {
            if (!res.next())
                return false;
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

                relationFieldUnionCache =
                    ((JDBCStoreManager) store)
                        .getCacheMapFromQuerySQLCache(RelationFieldStrategy.class);
            }
            boolean found = true;
            JDBCFetchConfiguration fetchClone = new JDBCFetchConfigurationImpl();
            fetchClone.copy(fetch);
            JDBCStoreManager.SelectKey selKey =
                new JDBCStoreManager.SelectKey(null, field, fetch);
            Object[] obj = relationFieldUnionCache.get(selKey);
            if (obj != null) {
                union = (Union) obj[0];
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

        }
    }
   
    private void updatePostgresBlob(Row row, Column col, JDBCStore store,
        Object ob, Select sel) throws SQLException {
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        SQLBuffer sql = sel.toSelect(true, fetch);
        ResultSet res = null;
        DelegatingConnection conn =
            (DelegatingConnection) store.getConnection();
        PreparedStatement stmnt = null;
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

        throws SQLException {
        //Do nothing
    }

    public void deleteStream(JDBCStore store, Select sel) throws SQLException {
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        SQLBuffer sql = sel.toSelect(true, fetch);
        ResultSet res = null;
        DelegatingConnection conn =
            (DelegatingConnection) store.getConnection();
        PreparedStatement stmnt = null;
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

        Select sel = store.getSQLFactory().newSelect();
        sel.select(cols);
        sel.wherePrimaryKey(sm.getObjectId(), vers.getClassMapping(), store);

        // No need to lock version field (i.e. optimistic), except when version update is required (e.g. refresh)
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        if (!updateVersion && fetch.getReadLockLevel() >= MixedLockLevels.LOCK_PESSIMISTIC_READ) {
            fetch = (JDBCFetchConfiguration) fetch.clone();
            fetch.setReadLockLevel(MixedLockLevels.LOCK_NONE);
        }
        Result res = sel.execute(store, fetch);
        try {
            if (!res.next())
                return false;
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

        customUpdate(sm, store);
    }

    public void customUpdate(OpenJPAStateManager sm, JDBCStore store)
        throws SQLException {
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        // select existing value for update
        Column col = field.getColumns()[0];
        Select sel = store.getSQLFactory().newSelect();
        sel.select(col);
        field.wherePrimaryKey(sel, sm, store);
View Full Code Here

Examples of org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration

        }
    }
   
    private void updatePostgresBlob(Row row, Column col, JDBCStore store,
        Object ob, Select sel) throws SQLException {
        JDBCFetchConfiguration fetch = store.getFetchConfiguration();
        SQLBuffer sql = sel.toSelect(true, fetch);
        ResultSet res = null;
        DelegatingConnection conn =
            (DelegatingConnection) store.getConnection();
        PreparedStatement stmnt = null;
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.