Package org.geotools.data.complex

Examples of org.geotools.data.complex.DataAccessMappingFeatureIterator


            throw new IOException(
                    "Internal error: Data Access Mapping feature Iterator expected but found "
                            + featureIterator);
        }

        DataAccessMappingFeatureIterator daFeatureIterator = (DataAccessMappingFeatureIterator) featureIterator;

        List<Expression> foreignIds = new ArrayList<Expression>();
        for (int i = 0; i < query.getQueryJoins().size(); i++) {
            for (int j = 0; j < query.getQueryJoins().get(i).getIds().size(); j++) {
                foreignIds.add(filterFac.property(JoiningJDBCFeatureSource.FOREIGN_ID + "_" + i
                        + "_" + j));
            }
        }
       
        daFeatureIterator.setForeignIds(foreignIds);

        instance.featureIterators.put(featureTypeName, daFeatureIterator);
        instance.nestedSourceExpressions.put(featureTypeName, nestedSourceExpression);

        for (Instance.Skip toSkip : instance.skipped) {
            while (daFeatureIterator.hasNext()
                    && daFeatureIterator.checkForeignIdValues(toSkip.idValues)) {
                daFeatureIterator.skip();
            }
        }

        return daFeatureIterator;
View Full Code Here


        Object featureTypeName = getNestedFeatureType(feature);
        if (featureTypeName == null || !(featureTypeName instanceof Name)) {
            throw new IllegalArgumentException(
                    "Internal error: Feature type name expected but found " + featureTypeName);
        }
        DataAccessMappingFeatureIterator featureIterator = instance.featureIterators
                .get((Name) featureTypeName);
        if (featureIterator == null) {
            featureIterator = initSourceFeatures(instance, (Name) featureTypeName, reprojection,
                    selectedProperties, includeMandatory, 0, null);
        }
        Expression nestedSourceExpression = instance.nestedSourceExpressions
                .get((Name) featureTypeName);
        if (nestedSourceExpression == null) {
            throw new IllegalArgumentException(
                    "Internal error: nested source expression expected but found "
                            + featureTypeName);
        }

        ArrayList<Feature> matchingFeatures = new ArrayList<Feature>();

        if (featureIterator != null) {
            while (featureIterator.hasNext()
                    && featureIterator.peekNextValue(nestedSourceExpression).toString()
                            .equals(foreignKeyValue.toString())
                    && featureIterator.checkForeignIdValues(idValues)) {
                matchingFeatures.addAll(featureIterator.skip());
            }
        }

        // skip all others
        for (Name name : instance.featureIterators.keySet()) {
            DataAccessMappingFeatureIterator fIt = instance.featureIterators.get(name);
            if (fIt != featureIterator) {
                skipFeatures(fIt, instance.nestedSourceExpressions.get(name), foreignKeyValue,
                        idValues);
            }
        }
View Full Code Here

        Object featureTypeName = getNestedFeatureType(feature);
        if (featureTypeName == null || !(featureTypeName instanceof Name)) {
            throw new IllegalArgumentException("Something is wrong!!");
        }
        DataAccessMappingFeatureIterator featureIterator = instance.featureIterators
                .get((Name) featureTypeName);
        if (featureIterator == null) {
            featureIterator = initSourceFeatures(instance, (Name) featureTypeName, reprojection,
                    selectedProperties, includeMandatory, resolveDepth, resolveTimeOut);
        }
        Expression nestedSourceExpression = instance.nestedSourceExpressions
                .get((Name) featureTypeName);
        if (nestedSourceExpression == null) {
            throw new IllegalArgumentException(
                    "Internal error: nested source expression expected but found "
                            + featureTypeName);
        }

        ArrayList<Feature> matchingFeatures = new ArrayList<Feature>();

        if (featureIterator != null) {
            while (featureIterator.hasNext()
                    && featureIterator.checkForeignIdValues(idValues)
                    && featureIterator.peekNextValue(nestedSourceExpression).toString()
                            .equals(foreignKeyValue.toString())) {
                matchingFeatures.add(featureIterator.next());
            }
        }

        // skip all others
        for (Name name : instance.featureIterators.keySet()) {
            DataAccessMappingFeatureIterator fIt = instance.featureIterators.get(name);
            if (fIt != featureIterator) {
                skipFeatures(fIt, instance.nestedSourceExpressions.get(name), foreignKeyValue,
                        idValues);
            }
        }
View Full Code Here

                    "Trying to read Joining Nested Attribute Mapping that is not open.");
        }

        // skip all
        for (Name name : instance.featureIterators.keySet()) {
            DataAccessMappingFeatureIterator fIt = instance.featureIterators.get(name);
            Expression nestedSourceExpression = instance.nestedSourceExpressions.get(name);
            skipFeatures(fIt, nestedSourceExpression, foreignKeyValue, idValues);
        }

        instance.skipped.add(new Instance.Skip(idValues));
View Full Code Here

TOP

Related Classes of org.geotools.data.complex.DataAccessMappingFeatureIterator

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.