Package org.apache.openjpa.jdbc.sql

Examples of org.apache.openjpa.jdbc.sql.Joins


        throws SQLException {
        // do same joins as for load
        //### cheat: we know typical result joins only care about the relation
        //### path; thus we can ignore different mappings
        ClassMapping elem = getDefaultElementMapping(true);
        Joins dataJoins = res.newJoins().setVariable("*");
        dataJoins = join(dataJoins, elem);
        dataJoins = joinElementRelation(dataJoins, elem);
        Joins orderJoins = null;
        if (field.getOrderColumn() != null) {
            orderJoins = res.newJoins().setVariable("*");
            orderJoins = join(orderJoins, elem);
        }

View Full Code Here


        if (field.getTypeCode() == JavaTypes.ARRAY)
            coll = new ArrayList();
        else
            coll = sm.newProxy(field.getIndex());

        Joins dataJoins = null;
        Joins refJoins = res.newJoins().setVariable("*");
        join(refJoins, false);

        ClassMapping ownerMapping = field.getDefiningMapping();
        Object ref = null;
        int seq = 0;
View Full Code Here

        sel.whereForeignKey(fk, oid, field.getDefiningMapping(), store);

        // order first, then select so that if the projection introduces
        // additional ordering, it will be after our required ordering
        field.orderLocal(sel, elem, null);
        Joins joins = joinElementRelation(sel.newJoins(), elem);
        field.orderRelation(sel, elem, joins);
        selectElement(sel, elem, store, fetch, eagerMode, joins);
        return joins;
    }
View Full Code Here

        // add class conditions so that they're cloned for any batched selects
        boolean joinedSupers = false;
        if ((sm == null || sm.getPCState() == PCState.TRANSIENT)
            && (subs == Select.SUBS_JOINABLE || subs == Select.SUBS_NONE)) {
            loadSubclasses(mapping);
            Joins joins = (outer) ? sel.newOuterJoins() : null;
            joinedSupers = mapping.getDiscriminator().addClassConditions(sel,
                subs == Select.SUBS_JOINABLE, joins);
        }

        // create all our eager selects so that those fields are reserved
View Full Code Here

        return seld > 0;
    }

    private boolean getJoinedSupers(Select sel, ClassMapping mapping, int subs, boolean outer) {
        loadSubclasses(mapping);
        Joins joins = (outer) ? sel.newOuterJoins() : null;
        return mapping.getDiscriminator().addClassConditions(sel, subs == Select.SUBS_JOINABLE, joins);
    }
View Full Code Here

    public void setImplicitType(Class type) {
    }

    public ExpState initialize(Select sel, ExpContext ctx, int flags) {
        ExpState[] states = new ExpState[_args.length];
        Joins joins = null;
        for (int i = 0; i < _args.length; i++) {
            states[i] = _args[i].initialize(sel, ctx, flags);
            if (joins == null)
                joins = states[i].joins;
            else
View Full Code Here

        ExpState argState = null;
        if (_target != null)
            targetState = _target.initialize(sel, ctx, JOIN_REL);
        if (_arg != null)
            argState = _arg.initialize(sel, ctx, JOIN_REL);
        Joins j1 = (targetState == null) ? null : targetState.joins;
        Joins j2 = (argState == null) ? null : argState.joins;
        return new ExtensionExpState(sel.and(j1, j2), targetState,
            argState);
    }
View Full Code Here

                ClassMapping cls = (clss.length == 0) ? null : clss[idx];
                sel.whereForeignKey(_strat.getJoinForeignKey(cls),
                    sm.getObjectId(), _strat.getFieldMapping().
                    getDefiningMapping(), store);

                Joins joins = null;
                Column[] cols;
                Object val;
                if (key) {
                    if (derivedKey)
                        joins = _strat.joinValueRelation(sel.newJoins(), cls);
View Full Code Here

     */
    public Joins join(Select sel) {
        if (_fk == null)
            return null;

        Joins joins = sel.newJoins();
        if (_outer)
            return joins.outerJoin(_fk, true, false);
        return joins.join(_fk, true, false);
    }
View Full Code Here

        // using a variable guarantees that the selected data will use different
        // aliases and joins than any existing WHERE conditions on this field
        // that might otherwise limit the elements of the field that match
        if (selectOid)
            sel.orderByPrimaryKey(field.getDefiningMapping(), true, true);
        Joins joins = sel.newJoins().setVariable("*");
        joins = join(joins, elem);

        // order, ref cols
        if (field.getOrderColumn() != null || field.getOrders().length > 0
            || !selectOid) {
View Full Code Here

TOP

Related Classes of org.apache.openjpa.jdbc.sql.Joins

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.