CPD Results

The following document contains the results of PMD's CPD 4.3.

Duplications

File Line
org/deegree/sqldialect/filter/AbstractWhereBuilder.java 558
org/deegree/sqldialect/filter/mssql/MSSQLWhereBuilder.java 122
    protected SQLOperation toProtoSQL( PropertyIsLike op )
                            throws UnmappableException, FilterEvaluationException {

        if ( !( op.getPattern() instanceof Literal ) ) {
            String msg = "Mapping of PropertyIsLike with non-literal comparisons to SQL is not implemented yet.";
            throw new UnsupportedOperationException( msg );
        }

        String literal = ( (Literal) op.getPattern() ).getValue().toString();
        String escape = "" + op.getEscapeChar();
        String wildCard = "" + op.getWildCard();
        String singleChar = "" + op.getSingleChar();

        SQLExpression propName = toProtoSQL( op.getExpression() );

        IsLikeString specialString = new IsLikeString( literal, wildCard, singleChar, escape );
        String sqlEncoded = specialString.toSQL( !op.isMatchCase() );

        if ( propName.isMultiValued() ) {
            // TODO escaping of pipe symbols
            sqlEncoded = "%|" + sqlEncoded + "|%";
        }

        SQLOperationBuilder builder = new SQLOperationBuilder( BOOLEAN );
File Line
org/deegree/sqldialect/filter/AbstractWhereBuilder.java 855
org/deegree/sqldialect/filter/AbstractWhereBuilder.java 889
        PropertyNameMapping propMapping = mapper.getMapping( propName, aliasManager );
        if ( propMapping != null ) {
            propNameMappingList.add( propMapping );
            if ( propMapping instanceof ConstantPropertyNameMapping ) {
                // TODO get rid of ConstantPropertyNameMapping
                PrimitiveType pt = new PrimitiveType( STRING );
                PrimitiveValue value = new PrimitiveValue( ""
                                                           + ( (ConstantPropertyNameMapping) propMapping ).getValue(),
                                                           pt );
                PrimitiveParticleConverter converter = new DefaultPrimitiveConverter( pt, null, false );
                sql = new SQLArgument( value, converter );
            } else {
                sql = new SQLColumn( propMapping.getTableAlias(), propMapping.getColumn(), propMapping.getConverter() );
            }
        } else {
            throw new UnmappableException( "Unable to map property '" + propName + "' to database column." );
        }
        return sql;
    }

    /**
     * Translates the given spatial {@link ValueReference} into an {@link SQLExpression}.
     * 
     * @param expr
     *            expression to be translated, must not be <code>null</code>
     * @return corresponding SQL expression, never <code>null</code>
     * @throws UnmappableException
     *             if translation is not possible (usually due to unmappable property names)
     * @throws FilterEvaluationException
     *             if the filter contains invalid {@link ValueReference}s
     */
    protected SQLExpression toProtoSQLSpatial( ValueReference propName )