Index: trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/mssqlserver/dal/MSSQLServerSQLBuilderTest.java
===================================================================
--- trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/mssqlserver/dal/MSSQLServerSQLBuilderTest.java	(revision 191)
+++ trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/mssqlserver/dal/MSSQLServerSQLBuilderTest.java	(revision 192)
@@ -6,9 +6,9 @@
 import org.cresques.cts.IProjection;
 import org.gvsig.fmap.crs.CRSFactory;
 import org.gvsig.fmap.dal.DALLocator;
-import org.gvsig.fmap.dal.ExpressionBuilder;
-import org.gvsig.fmap.dal.ExpressionBuilder.Parameter;
-import org.gvsig.fmap.dal.ExpressionBuilder.Variable;
+import org.gvsig.expressionevaluator.ExpressionBuilder;
+import org.gvsig.expressionevaluator.ExpressionBuilder.Parameter;
+import org.gvsig.expressionevaluator.ExpressionBuilder.Variable;
 import org.gvsig.fmap.dal.SQLBuilder;
 import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
 import org.gvsig.fmap.dal.store.db.DBHelper;
Index: trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/fmap/dal/store/jdbc2/ExpressionBuilderTest.java
===================================================================
--- trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/fmap/dal/store/jdbc2/ExpressionBuilderTest.java	(revision 191)
+++ trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/fmap/dal/store/jdbc2/ExpressionBuilderTest.java	(revision 192)
@@ -1,209 +0,0 @@
-package org.gvsig.fmap.dal.store.jdbc2;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.commons.lang3.ArrayUtils;
-import org.cresques.cts.IProjection;
-import org.gvsig.fmap.crs.CRSFactory;
-import org.gvsig.fmap.dal.ExpressionBuilder;
-import org.gvsig.fmap.dal.ExpressionBuilder.Config;
-import org.gvsig.fmap.dal.ExpressionBuilder.GeometrySupportType;
-import org.gvsig.fmap.dal.ExpressionBuilder.Parameter;
-import static org.gvsig.fmap.dal.ExpressionBuilder.ParameterType.Constant;
-import org.gvsig.fmap.dal.ExpressionBuilder.Variable;
-import org.gvsig.fmap.dal.feature.spi.ExpressionBuilderBase;
-import org.gvsig.fmap.geom.Geometry;
-import org.gvsig.fmap.geom.GeometryLocator;
-import org.gvsig.fmap.geom.GeometryManager;
-import org.gvsig.fmap.geom.exception.CreateGeometryException;
-import org.gvsig.fmap.geom.primitive.Point;
-import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
-
-public class ExpressionBuilderTest extends AbstractLibraryAutoInitTestCase {
-    
-    @Override
-    protected void doSetUp() throws Exception {
-
-    }
-    
-    List<String> getVariableNames(ExpressionBuilder builder) {
-        List<String> vars = new ArrayList<>();
-        for (Variable var : builder.getVariables()) {
-            vars.add(var.getName());
-        }
-        return vars;
-    }
-    
-    List<String> getParameterNames(ExpressionBuilder builder) {
-        List<String> params = new ArrayList<>();
-        for (Parameter param : builder.getParameters()) {
-            String s;
-            switch(param.getType()) {
-                case Constant:
-                    Object value = param.getValue();
-                    if( value==null ) {
-                        s = "null";
-                    } else if( value instanceof String ) {
-                        s = "'" + (String)value + "'";
-                    } else {
-                        s = value.toString();
-                    }    
-                    break;
-                case Geometry:
-                case Variable:
-                default:
-                    s = "\"" + param.getName() + "\"";
-            }
-            params.add(s);
-        }
-        return params;
-    }
-    
-    public void test2() {
-        ExpressionBuilder builder = new ExpressionBuilderBase();
-        
-        builder.and(
-          builder.eq(
-            builder.lcase(builder.variable("colum_name_c")),
-            builder.parameter("colum_name_p")
-          )
-        );
-        builder.and(
-            builder.group(
-                builder.or(
-                    builder.like(
-                        builder.lcase( builder.variable("uno")),
-                        builder.constant("%10")
-                    ),
-                    builder.lt(
-                        builder.variable("dos"),
-                        builder.constant(-3.5)
-                    )
-                )
-            )
-        );
-        builder.and(
-                builder.ST_Intersects(
-                    builder.variable("geom1"), 
-                    builder.ST_Envelope(
-                        builder.ST_GeomFromWKB(
-                                builder.parameter("geom2"), 
-                                builder.parameter().value(4326).as_constant()
-                        )
-                    )
-                )
-        );
-        builder.and(
-            builder.gt(
-                builder.variable("tres"),
-                builder.constant(123456789)
-            )
-        );
-        assertEquals(
-                "( (LCASE(\"colum_name_c\")) = (?) ) AND ( ( (LCASE(\"uno\")) LIKE ('%10') ) OR ( (\"dos\") < (-3.5) ) ) AND ST_Intersects((\"geom1\"), (ST_Envelope(ST_GeomFromWKB((?), (?))))) AND ( (\"tres\") > (123456789) )",
-                builder.toString()
-        );
-        assertEquals(
-                "[colum_name_c, dos, geom1, tres, uno]",
-                ArrayUtils.toString(getVariableNames(builder))
-        );
-        assertEquals(
-                "[\"colum_name_p\", \"geom2\", 4326]",
-                ArrayUtils.toString(getParameterNames(builder))
-        );
-    }
-    
-    public void test3() throws CreateGeometryException {
-        ExpressionBuilder builder = new ExpressionBuilderBase();
-                
-        GeometryManager geometryManager = GeometryLocator.getGeometryManager();
-        IProjection proj = CRSFactory.getCRS("EPSG:4326");
-        
-        Point point = geometryManager.createPoint(10, 20, Geometry.SUBTYPES.GEOM2D);
-        builder.set(        
-            builder.ST_Intersects(
-              builder.geometry(point,proj),
-              builder.variable("the_geom")
-            )
-        );
-        builder.getConfig().set(Config.geometry_type_support, GeometrySupportType.WKT);
-        System.out.println(builder.toString());
-        assertEquals(
-                "ST_Intersects((ST_GeomFromText('POINT (10 20)', (4326))), (\"the_geom\"))",
-                builder.toString()
-        );
-        builder.getConfig().set(Config.geometry_type_support, GeometrySupportType.WKB);
-        System.out.println(builder.toString());
-        assertEquals(
-                "ST_Intersects((ST_GeomFromWKB((0x000000000140240000000000004034000000000000), (4326))), (\"the_geom\"))",
-                builder.toString()
-        );
-        assertEquals(
-                "[the_geom]",
-                ArrayUtils.toString(getVariableNames(builder))
-        );
-        assertEquals(
-                "[]",
-                ArrayUtils.toString(getParameterNames(builder))
-        );
-    }
-    
-    public void test4() throws CreateGeometryException {
-        ExpressionBuilder builder = new ExpressionBuilderBase();
-                
-        IProjection proj = CRSFactory.getCRS("EPSG:4326");
-        
-        builder.and(
-                builder.ST_Intersects(
-                    builder.variable("geom1"), 
-                    builder.ST_Envelope(
-                        builder.ST_GeomFromWKB(
-                                builder.parameter("geom2"), 
-                                builder.parameter().value(proj).as_constant()
-                        )
-                    )
-                )
-        );
-        
-        System.out.println(builder.toString());
-        assertEquals(
-                "ST_Intersects((\"geom1\"), (ST_Envelope(ST_GeomFromWKB((?), (?)))))",
-                builder.toString()
-        );
-        assertEquals(
-                "[geom1]",
-                ArrayUtils.toString(getVariableNames(builder))
-        );
-        assertEquals(
-                "[\"geom2\", 4326]",
-                ArrayUtils.toString(getParameterNames(builder))
-        );
-    }
-        
-    public void test5() throws CreateGeometryException {
-        ExpressionBuilder builder = new ExpressionBuilderBase();
-                
-        IProjection proj = CRSFactory.getCRS("EPSG:4326");
-        
-        builder.and(
-                builder.eq(
-                        builder.ST_SRID( builder.variable("geom") ),
-                        builder.srs(proj)
-                )
-        );
-        
-        System.out.println(builder.toString());
-        assertEquals(
-                "( (ST_SRID(\"geom\")) = (4326) )",
-                builder.toString()
-        );
-        assertEquals(
-                "[geom]",
-                ArrayUtils.toString(getVariableNames(builder))
-        );
-        assertEquals(
-                "[]",
-                ArrayUtils.toString(getParameterNames(builder))
-        );
-    }
-}
Index: trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/fmap/dal/store/jdbc2/SQLBuilderTest.java
===================================================================
--- trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/fmap/dal/store/jdbc2/SQLBuilderTest.java	(revision 191)
+++ trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/test/java/org/gvsig/fmap/dal/store/jdbc2/SQLBuilderTest.java	(revision 192)
@@ -5,10 +5,9 @@
 import org.apache.commons.lang3.ArrayUtils;
 import org.cresques.cts.IProjection;
 import org.gvsig.fmap.crs.CRSFactory;
-import org.gvsig.fmap.dal.ExpressionBuilder;
-import org.gvsig.fmap.dal.ExpressionBuilder.Constant;
-import org.gvsig.fmap.dal.ExpressionBuilder.Parameter;
-import org.gvsig.fmap.dal.ExpressionBuilder.Variable;
+import org.gvsig.expressionevaluator.ExpressionBuilder;
+import org.gvsig.expressionevaluator.ExpressionBuilder.Parameter;
+import org.gvsig.expressionevaluator.ExpressionBuilder.Variable;
 import org.gvsig.fmap.dal.SQLBuilder;
 import org.gvsig.fmap.dal.SQLBuilder.Privilege;
 import org.gvsig.fmap.dal.feature.spi.SQLBuilderBase;
Index: trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/main/java/org/gvsig/mssqlserver/dal/MSSQLServerSQLBuilder.java
===================================================================
--- trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/main/java/org/gvsig/mssqlserver/dal/MSSQLServerSQLBuilder.java	(revision 191)
+++ trunk/org.gvsig.mssqlserver/org.gvsig.mssqlserver.provider/src/main/java/org/gvsig/mssqlserver/dal/MSSQLServerSQLBuilder.java	(revision 192)
@@ -446,7 +446,7 @@
     @Override
     public Function ST_ExtentAggregate(Value geom) {
         String spatialType = getHelper().getSpatialType();
-        return function("ST_ExtentAggregate", 
+        return builtin_function("ST_ExtentAggregate", 
                 config.getString(MSSQLServerSQLConfig.ST_ExtentAggregateEx), 
                 geom,
                 custom(spatialType)
@@ -456,7 +456,7 @@
     @Override
     public Function ST_UnionAggregate(Value geom) {
         String spatialType = getHelper().getSpatialType();
-        return function("ST_UnionAggregate", 
+        return builtin_function("ST_UnionAggregate", 
                 config.getString(MSSQLServerSQLConfig.ST_UnionAggregateEx), 
                 geom,
                 custom(spatialType)
@@ -466,7 +466,7 @@
     @Override
     public Function ST_GeomFromText(Value geom, Value crs) {
         String spatialType = getHelper().getSpatialType();
-        return function("ST_GeomFromText", 
+        return builtin_function("ST_GeomFromText", 
                 config.getString(MSSQLServerSQLConfig.ST_GeomFromTextEx), 
                 geom, 
                 crs,
@@ -477,7 +477,7 @@
     @Override
     public Function ST_GeomFromWKB(Value geom, Value crs) {
         String spatialType = getHelper().getSpatialType();
-        return function("ST_GeomFromWKB", 
+        return builtin_function("ST_GeomFromWKB", 
                 config.getString(MSSQLServerSQLConfig.ST_GeomFromWKBEx), 
                 geom, 
                 crs,
@@ -488,7 +488,7 @@
     @Override
     public Function ST_GeomFromEWKB(Value geom, Value crs) {
         String spatialType = getHelper().getSpatialType();
-        return function("ST_GeomFromEWKB", 
+        return builtin_function("ST_GeomFromEWKB", 
                 config.getString(MSSQLServerSQLConfig.ST_GeomFromEWKBEx), 
                 geom, 
                 crs,
