Revision 47606 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.geometry/org.gvsig.expressionevaluator.geometry.lib/org.gvsig.expressionevaluator.geometry.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/DefaultGeometryExpressionBuilderHelper.java

View differences:

DefaultGeometryExpressionBuilderHelper.java
426 426
                                this.getSRS()
427 427
                        );
428 428
                    case NATIVE:
429
                        return MessageFormat.format("DECODE('{0}','hex')",
429
                        return MessageFormat.format("DECODE(''{0}'',''hex'')",
430 430
                                this.builder.builder().bytearray_hex(
431 431
                                    GeometryUtils.toEWKB((Geometry) geometry)
432 432
                                )
......
491 491
    }
492 492

  
493 493
    protected GeometrySupportType geometrySupportType;
494
    protected ExpressionBuilder builder;
494
    private ExpressionBuilder builder;
495 495

  
496 496
    public DefaultGeometryExpressionBuilderHelper(ExpressionBuilder builder) {
497 497
        this.builder = builder;
......
529 529
    @Override
530 530
    public Constant srs(IProjection projection) {
531 531
        if( projection == null ) {
532
            return this.builder.constant(null);
532
            return this.builder().constant(null);
533 533
        }
534 534
        return new ProjectionConstant(this, projection);
535 535
    }
......
537 537
    @Override
538 538
    public Constant geometry(Geometry geom, IProjection projection) {
539 539
        if( geom == null ) {
540
            return this.builder.constant(null);
540
            return this.builder().constant(null);
541 541
        }
542 542
        geom.setProjection(projection);
543 543
        return new GeometryConstant(this, geom);
......
546 546
    @Override
547 547
    public Constant geometry(Geometry geom) {
548 548
        if( geom == null ) {
549
            return this.builder.constant(null);
549
            return this.builder().constant(null);
550 550
        }
551 551
        if( geom.getProjection()==null ) {
552 552
            throw new IllegalArgumentException("The geometry does not have an associated projection. Use 'geometry(Geometry, IProjection)'.");
......
557 557
    @Override
558 558
    public Constant envelope(Envelope envelope, IProjection projection) {
559 559
        if( envelope == null ) {
560
            return this.builder.constant(null);
560
            return this.builder().constant(null);
561 561
        }
562 562
        Geometry geom = envelope.getGeometry();
563 563
        geom.setProjection(projection);
......
567 567
    @Override
568 568
    public Constant envelope(Envelope envelope) {
569 569
        if( envelope == null ) {
570
            return this.builder.constant(null);
570
            return this.builder().constant(null);
571 571
        }
572 572
        if( envelope.getProjection()==null ) {
573 573
            throw new IllegalArgumentException("The envelope does not have an associated projection. Use 'envelope(Geometry, IProjection)'.");
......
597 597
    }
598 598

  
599 599
    public Function builtin_function(String name, String format, Value... values) {
600
        Function func = this.builder.function(name, values);
600
        Function func = this.builder().function(name, values);
601 601
        func.format(format);
602 602
        return func;
603 603
    }    
604 604
    
605 605
    public Function function(String name, Value... values) {
606
        Function func = this.builder.function(name, values);
606
        Function func = this.builder().function(name, values);
607 607
        return func;
608 608
    }    
609 609
    
610 610
    @Override
611
    public Function as_geometry(Value value) {
611
    public Value as_geometry(Value value) {
612 612
        return builtin_function(FUNCTION_ST_ASBINARY, FORMAT_ST_ASBINARY, value);
613 613
    }
614 614

  

Also available in: Unified diff