Package org.geotools.data.complex

Examples of org.geotools.data.complex.AttributeMapping


        JoiningQuery query = new JoiningQuery();
        query.setCoordinateSystemReproject(reprojection);

        FeatureTypeMapping fMapping = AppSchemaDataAccessRegistry.getMappingByName(featureTypeName);

        AttributeMapping mapping = fMapping
                .getAttributeMapping(this.nestedTargetXPath);
        if (mapping == null) {
            throw new IllegalArgumentException("Mapping is missing for: '" + this.nestedTargetXPath
                    + "'!");
        }
        Expression nestedSourceExpression = mapping.getSourceExpression();

        List<JoiningQuery.QueryJoin> joins = new ArrayList<JoiningQuery.QueryJoin>();
        if (instance.baseTableQuery instanceof JoiningQuery) {
            if (((JoiningQuery) instance.baseTableQuery).getQueryJoins() != null) {
                joins.addAll(((JoiningQuery) instance.baseTableQuery).getQueryJoins());
View Full Code Here


                    throw new DataSourceException(msg);
                }
            } else {
                expectedInstanceOf = null;
            }
            AttributeMapping attMapping;
            String sourceElement = attDto.getLinkElement();           
            if (sourceElement != null) {
                // nested complex attributes, this could be a function expression for polymorphic
                // types
                Expression elementExpr = parseOgcCqlExpression(sourceElement);
                String sourceField = attDto.getLinkField();
                StepList sourceFieldSteps = null;
                if (sourceField != null) {
                    // it could be null for polymorphism mapping,
                    // i.e. when the linked element maps to the same table as the container mapping
                    sourceFieldSteps = XPath.steps(root, sourceField, namespaces);
                }
                // a nested feature
                if (isJoining() && isJDBC) {
                    attMapping = new JoiningNestedAttributeMapping(idExpression, sourceExpression,
                            targetXPathSteps, isMultiValued, clientProperties, elementExpr,
                            sourceFieldSteps, namespaces);
                } else {
                    attMapping = new NestedAttributeMapping(idExpression, sourceExpression,
                        targetXPathSteps, isMultiValued, clientProperties, elementExpr,
                        sourceFieldSteps, namespaces);
                }
               
            } else {
                attMapping = new AttributeMapping(idExpression, sourceExpression, attDto.getSourceIndex(), targetXPathSteps,
                        expectedInstanceOf, isMultiValued, clientProperties);
            }
           
            if (attDto.isList()) {
                attMapping.setList(true);
            }
           
            if (attDto.encodeIfEmpty()) {
                attMapping.setEncodeIfEmpty(true);
            }

            /**
             * Label and parent label are specific for web service backend
             */
            if (attDto.getLabel() != null) {
                attMapping.setLabel(attDto.getLabel());
            }
            if (attDto.getParentLabel() != null) {
                attMapping.setParentLabel(attDto.getParentLabel());
            }
            if (attDto.getInstancePath() != null) {
                attMapping.setInstanceXpath(attDto.getInstancePath());
            }
           
            attMappings.add(attMapping);
        }
        return attMappings;
View Full Code Here

        NamespaceSupport namespaces = new NamespaceSupport();

        Function aoiExpr = ff.function("buffer", ff.property("location"), ff.literal(10));

        attMappings.add(new AttributeMapping(null, aoiExpr, XPath.steps(targetFeature,
                "areaOfInfluence", namespaces)));

        Function strConcat = ff.function("strConcat", ff.property("anzlic_no"), ff
                .property("project_no"));

        attMappings.add(new AttributeMapping(null, strConcat, XPath.steps(targetFeature,
                "concatenated", namespaces)));

        FeatureSource<?,?> simpleSource = mapping.getSource();
        FeatureTypeMapping mapping = new FeatureTypeMapping(simpleSource, targetFeature,
                attMappings, namespaces);
View Full Code Here

     *
     * @param idExpression
     * @throws Exception
     */
    private void checkUnrollIdExpression(Expression idExpression) throws Exception {
        AttributeMapping featureMapping = null;
        Name featurePath = mapping.getTargetFeature().getName();
        QName featureName = Types.toQName(featurePath);
        for (Iterator it = mapping.getAttributeMappings().iterator(); it.hasNext();) {
            AttributeMapping attMapping = (AttributeMapping) it.next();
            StepList targetXPath = attMapping.getTargetXPath();
            if (targetXPath.size() > 1) {
                continue;
            }
            Step step = (Step) targetXPath.get(0);
            if (featureName.equals(step.getName())) {
View Full Code Here

        String name = target.getLocalPart();

        Expression fidExpression = null;

        for (Iterator it = mappings.getAttributeMappings().iterator(); it.hasNext();) {
            AttributeMapping attMapping = (AttributeMapping) it.next();
            StepList targetXPath = attMapping.getTargetXPath();
            if (targetXPath.size() > 1) {
                continue;
            }

            Step step = (Step) targetXPath.get(0);
            QName stepName = step.getName();
            if (namespace.equals(stepName.getNamespaceURI())) {
                if (name.equals(stepName.getLocalPart())) {
                    fidExpression = attMapping.getIdentifierExpression();
                    break;
                }
            }
        }
View Full Code Here

TOP

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

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.