Index: TestCreate.java
===================================================================
--- TestCreate.java	(revision 46049)
+++ TestCreate.java	(revision 46050)
@@ -1,5 +1,6 @@
 package org.gvsig.fmap.dal.store.h2;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import junit.framework.TestCase;
@@ -12,6 +13,7 @@
 import org.gvsig.fmap.dal.DataStore;
 import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
 import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
 import org.gvsig.fmap.dal.feature.EditableFeatureType;
 import org.gvsig.fmap.dal.feature.Feature;
 import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
@@ -19,8 +21,10 @@
 import org.gvsig.fmap.dal.feature.FeatureStore;
 import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
+import org.gvsig.fmap.dal.impl.expressionevaluator.DefaultFeatureAttributeEmulatorExpression;
 import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
 import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer;
+import org.gvsig.tools.dispose.DisposeUtils;
 import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -307,5 +311,108 @@
         List<Feature> features = h2Store.getFeatures(query);
         int sz = features.size();
     }
+    
+    public void testComputed1() throws Exception {
+        FeatureStore sourceStore = TestUtils.openSourceStore1();
+        JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME);
+        
+        createFrom(explorer, sourceStore);        
+        copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND);
+      
+        FeatureStore h2Store = openTargetStore1(explorer);
+        h2Store.edit();
+        FeatureType featureType = h2Store.getDefaultFeatureType();
+        EditableFeatureType eFeatureType = featureType.getEditable();
+        eFeatureType.add("Compu1", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("ID*2")));
+        eFeatureType.add("Compu2", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Long+10+Compu1")));
+        h2Store.update(eFeatureType);
+        h2Store.finishEditing();
+        List<Feature> features = h2Store.getFeatures();
+        for (int i = 0; i < features.size(); i++) {
+            Feature feature = features.get(i);
+            assertEquals("Compu1 "+i, feature.getInt("ID") * 2, feature.getInt("Compu1"));
+            if(feature.get("Long")==null) {
+                assertEquals("Compu2 "+i, null, feature.get("Compu2"));
+            } else {
+                assertEquals("Compu2 "+i, feature.getInt("Long") + 10 + feature.getInt("Compu1"), feature.getInt("Compu2"));
+            }
+        }
+        DisposeUtils.dispose(h2Store);
+    }
+    
+    public void testComputed2() throws Exception {
+        FeatureStore sourceStore = TestUtils.openSourceStore1();
+        JDBCServerExplorer explorer = TestUtils.openServerExplorer(DBNAME);
+        
+        createFrom(explorer, sourceStore);        
+        copyFrom(explorer, sourceStore, FeatureStore.MODE_APPEND);
+      
+        FeatureStore h2Store = openTargetStore1(explorer);
+        h2Store.edit();
+        FeatureType featureType = h2Store.getDefaultFeatureType();
+        EditableFeatureType eFeatureType = featureType.getEditable();
+        FeatureQuery query = sourceStore.createFeatureQuery();
+        eFeatureType.add("Compu1", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("MOD(ID,10)")));
+        eFeatureType.add("Compu2", DataTypes.INTEGER, new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Long+300")));
+        EditableFeatureAttributeDescriptor extraColumn1 = query.getExtraColumn().add("Extra1", DataTypes.INTEGER);
+        EditableFeatureAttributeDescriptor extraColumn2 = query.getExtraColumn().add("Extra2", DataTypes.INTEGER);
+//        EditableFeatureAttributeDescriptor extraColumn3 = query.getExtraColumn().add("LongMax", DataTypes.INTEGER);
+        extraColumn1.setFeatureAttributeEmulator(new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Compu1+1")));
+        extraColumn2.setFeatureAttributeEmulator(new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("20+Byte")));
+//        extraColumn3.setFeatureAttributeEmulator(new DefaultFeatureAttributeEmulatorExpression(eFeatureType, ExpressionUtils.createExpression("Long")));
+        query.getGroupByColumns().add("Decimal");
+        query.getGroupByColumns().add("Extra1");
+//        query.getGroupByColumns().add("Compu1");
+        query.getAggregateFunctions().put("ID", "MIN");
+        query.getAggregateFunctions().put("Byte", "MIN");
+//        query.getAggregateFunctions().put("Long", "MIN");
+//        query.getAggregateFunctions().put("LongMax", "MAX");
+        query.getAggregateFunctions().put("Compu1", "MIN");
+        query.getAggregateFunctions().put("Double", "SUM");
+        query.getAggregateFunctions().put("Extra2", "SUM");
+        query.getAggregateFunctions().put("Compu2", "SUM");
+        h2Store.update(eFeatureType);
+        h2Store.finishEditing();
+        
+        
+        List<Feature> features0 = h2Store.getFeatures(query);
+        ArrayList<Feature> features = new ArrayList<>();
+        
+        for (int i = 0; i < features0.size(); i++) {
+            Feature feature = features0.get(i);
+            features.add(feature.getCopy());
+        }
+        features0 = null;
+        features.get(1).get("Compu1");
+        features.get(1).get("Compu2");
+//        assertEquals("Long0",null,features.get(0).get("Long"));
+//        assertEquals("Long1",null,features.get(1).get("Long"));
+//        assertEquals("Long2",1000L,features.get(2).getLong("Long"));
+//        assertEquals("Long3",1001L,features.get(3).getLong("Long"));
+//        assertEquals("Long4",2000L,features.get(4).getLong("Long"));
+//        assertEquals("Long5",2002L,features.get(5).getLong("Long"));
+//        assertEquals("Long6",3000L,features.get(6).getLong("Long"));
+//        assertEquals("Long7",4000L,features.get(7).getLong("Long"));
+//        assertEquals("Long8",4001L,features.get(8).getLong("Long"));
+//        assertEquals("Long9",5000L,features.get(9).getLong("Long"));
+//        assertEquals("Long10",5002L,features.get(10).getLong("Long"));
+//        assertEquals("Long11",6000L,features.get(11).getLong("Long"));
+//        assertEquals("Long12",6003L,features.get(12).getLong("Long"));
+//        assertEquals("Long13",7000L,features.get(13).getLong("Long"));
+//        assertEquals("Long14",7004L,features.get(14).getLong("Long"));
+//        assertEquals("Long15",8000L,features.get(15).getLong("Long"));
+//        assertEquals("Long16",8005L,features.get(16).getLong("Long"));
+//        assertEquals("Long17",9000L,features.get(17).getLong("Long"));
+//        assertEquals("Long18",9006L,features.get(18).getLong("Long"));
+        
+//        for (int i = 0; i < features.size(); i++) {
+//            Feature feature = features.get(i);
+//            assertEquals("Long", feature.getInt("ID") * 2, feature.getInt("Compu1"));
+//            assertEquals("Compu2", feature.getInt("Long") + 10 + feature.getInt("Compu1"), feature.getInt("Compu2"));
+//        }
+        DisposeUtils.dispose(h2Store);
+    }
+    
+    
 
 }
