Examples of Joinable


Examples of org.apache.openjpa.jdbc.meta.Joinable

        Object[] pks = null;
        if (mapping.getIdentityType() == ClassMapping.ID_APPLICATION)
            pks = ApplicationIds.toPKValues(oid, mapping);

        SQLBuffer buf = new SQLBuffer(_dict);
        Joinable join;
        Object val;
        int count = 0;
        for (int i = 0; i < toCols.length; i++, count++) {
            if (pks == null)
                val = (oid == null) ? null : Numbers.valueOf(((Id) oid).getId());
            else {
                // must be app identity; use pk index to get correct pk value
                join = mapping.assertJoinable(toCols[i]);
                val = pks[mapping.getField(join.getFieldIndex()).
                    getPrimaryKeyIndex()];
                val = join.getJoinValue(val, toCols[i], store);
            }

            if (count > 0)
                buf.append(" AND ");
            buf.append(getColumnAlias(fromCols[i], pj));
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        col = field.getForeignKey().getPrimaryKeyColumn(col);
        if (col == null)
            throw new InternalException();

        ClassMapping relmapping = field.getTypeMapping();
        Joinable j = field.getTypeMapping().assertJoinable(col);
        if (ImplHelper.isManageable(fieldVal))
            fieldVal = store.getContext().getObjectId(fieldVal);
        if (fieldVal instanceof OpenJPAId)
            fieldVal = ((OpenJPAId) fieldVal).getIdObject();
        else if (relmapping.getObjectIdType() != null
            && relmapping.getObjectIdType().isInstance(fieldVal)) {
            Object[] pks = ApplicationIds.toPKValues(fieldVal, relmapping);
            fieldVal = pks[relmapping.getField(j.getFieldIndex()).
                getPrimaryKeyIndex()];
        }
        return j.getJoinValue(fieldVal, col, store);
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        }
        if (set && !canSetAny(io, fromCols.length, false))
            return;

        ClassMapping toMapping = (ClassMapping) to.getMetaData();
        Joinable join;
        Object val;
        for (int i = 0; i < toCols.length; i++) {
            // don't even translate join value if unsettable
            if (set) {
                if (_action == ACTION_INSERT && fromCols[i].isAutoAssigned())
                    continue;
                if (!canSet(io, i, false))
                    continue;
            }

            join = toMapping.assertJoinable(toCols[i]);
            val = join.getJoinValue(to, toCols[i], (JDBCStore) to.
                getContext().getStoreManager().getInnermostDelegate());
            if (set && val == null) {
                if (canSet(io, i, true))
                    setNull(fromCols[i]);
            } else if (set && val instanceof Raw)
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        boolean relationId = RelationStrategies.isRelationId(fromCols);
        if (!relationId && mapping.getIdentityType() == ClassMapping.ID_APPLICATION)
            pks = ApplicationIds.toPKValues(oid, mapping);

        SQLBuffer buf = new SQLBuffer(_dict);
        Joinable join;
        Object val;
        int count = 0;
        for (int i = 0; i < toCols.length; i++, count++) {
            if (pks == null) {
                val = (oid == null) ? null : relationId ? oid : ((Id) oid).getId();
            } else {
                // must be app identity; use pk index to get correct pk value
                join = mapping.assertJoinable(toCols[i]);
                val = pks[mapping.getField(join.getFieldIndex()).
                    getPrimaryKeyIndex()];
                val = join.getJoinValue(val, toCols[i], store);
            }

            if (count > 0)
                buf.append(" AND ");
            buf.append(getColumnAlias(fromCols[i], pj));
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        return fetch.hasFetchGroup(FetchGroup.NAME_DEFAULT);
    }
   
    private boolean checkResult(FieldMapping fm, Result res) {
        if (fm.getStrategy() instanceof Joinable) {
            Joinable strat = (Joinable)fm.getStrategy();
            Column[] cols = strat.getColumns();
            for (Column col : cols) {
                try {
                    if (res.contains(col)) {
                        return true;
                    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        }
        if (set && !canSetAny(io, fromCols.length, false))
            return;

        ClassMapping toMapping = (ClassMapping) to.getMetaData();
        Joinable join;
        Object val;
        for (int i = 0; i < toCols.length; i++) {
            // don't even translate join value if unsettable
            if (set) {
                if (_action == ACTION_INSERT && fromCols[i].isAutoAssigned())
                    continue;
                if (!canSet(io, i, false))
                    continue;
            }

            join = toMapping.assertJoinable(toCols[i]);
            if (oid != null)
                val = join.getJoinValue(oid, toCols[i], (JDBCStore) to.
                    getContext().getStoreManager().getInnermostDelegate());
            else
                val = join.getJoinValue(to, toCols[i], (JDBCStore) to.
                    getContext().getStoreManager().getInnermostDelegate());

            if (set && val == null) {
                if (canSet(io, i, true))
                    setNull(fromCols[i]);
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        boolean relationId = RelationStrategies.isRelationId(fromCols);
        if (!relationId && mapping.getIdentityType() == ClassMapping.ID_APPLICATION)
            pks = ApplicationIds.toPKValues(oid, mapping);

        SQLBuffer buf = new SQLBuffer(_dict);
        Joinable join;
        Object val;
        int count = 0;
        for (int i = 0; i < toCols.length; i++, count++) {
            if (pks == null) {
                val = (oid == null) ? null : relationId ? oid : ((Id) oid).getId();
            } else {
                // must be app identity; use pk index to get correct pk value
                join = mapping.assertJoinable(toCols[i]);
                val = pks[mapping.getField(join.getFieldIndex()).
                    getPrimaryKeyIndex()];
                val = join.getJoinValue(val, toCols[i], store);
            }

            if (count > 0)
                buf.append(" AND ");
            buf.append(getColumnAlias(fromCols[i], pj));
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

        col = field.getForeignKey().getPrimaryKeyColumn(col);
        if (col == null)
            throw new InternalException();

        ClassMapping relmapping = field.getTypeMapping();
        Joinable j = field.getTypeMapping().assertJoinable(col);
        if (ImplHelper.isManageable(fieldVal))
            fieldVal = store.getContext().getObjectId(fieldVal);
        if (fieldVal instanceof OpenJPAId)
            fieldVal = ((OpenJPAId) fieldVal).getIdObject();
        if (relmapping.getObjectIdType() != null
            && relmapping.getObjectIdType().isInstance(fieldVal)) {
            Object[] pks = ApplicationIds.toPKValues(fieldVal, relmapping);
            fieldVal = pks[relmapping.getField(j.getFieldIndex()).
                getPrimaryKeyIndex()];
        }
        return j.getJoinValue(fieldVal, col, store);
    }
View Full Code Here

Examples of org.apache.openjpa.jdbc.meta.Joinable

      boolean collectParmValueOnly = (parmList != null ? true : false);
        Object[] pks = null;
        if (mapping.getIdentityType() == ClassMapping.ID_APPLICATION)
            pks = ApplicationIds.toPKValues(oid, mapping);

        Joinable join;
        Object val;
        int count = 0;
        for (int i = 0; i < toCols.length; i++, count++) {
            if (pks == null)
                val = (oid == null) ? null : Numbers.valueOf(((Id) oid).getId());
            else {
                // must be app identity; use pk index to get correct pk value
                join = mapping.assertJoinable(toCols[i]);
                val = pks[mapping.getField(join.getFieldIndex()).
                    getPrimaryKeyIndex()];
                val = join.getJoinValue(val, toCols[i], store);
                if (parmList != null)
                  parmList.add(val);
            }
           
            if (collectParmValueOnly)
View Full Code Here

Examples of org.hibernate.persister.entity.Joinable

    // property represents no association, so no inverse meta-data can exist
    if ( !propertyType.isAssociationType() ) {
      return null;
    }

    Joinable mainSideJoinable = ( (AssociationType) propertyType ).getAssociatedJoinable( factory );
    OgmEntityPersister inverseSidePersister = null;

    // to-many association
    if ( mainSideJoinable.isCollection() ) {
      inverseSidePersister = (OgmEntityPersister) ( (OgmCollectionPersister) mainSideJoinable ).getElementPersister();
    }
    // to-one
    else {
      inverseSidePersister = (OgmEntityPersister) mainSideJoinable;
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.