Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureType.java	(revision 44435)
@@ -553,6 +553,25 @@
                 .toArray(new FeatureAttributeDescriptor[super.size()]);
     }
 
+    @Override
+    public boolean hasPrimaryKey() {
+        if( pk!=null ) {
+            return pk.length>0;
+        }
+        for (FeatureAttributeDescriptor attr : this) {
+            if( attr.isPrimaryKey() ) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean supportReferences() {
+        return this.hasOID() || this.hasPrimaryKey();
+    }
+    
+    @Override
     public FeatureAttributeDescriptor[] getPrimaryKey() {
         if (pk == null) {
             List pks = new ArrayList();
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureStore.java	(revision 44435)
@@ -3098,5 +3098,15 @@
             }
             return sampleFeature;
     }
-        
+
+    @Override
+    public boolean supportReferences() {
+        try {
+            return this.getDefaultFeatureType().supportReferences();
+        } catch (Exception ex) {
+            return false;
+        }
+    }
+ 
+    
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureSelection.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureSelection.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureSelection.java	(revision 44435)
@@ -783,5 +783,9 @@
 
     }
 
+    @Override
+    public boolean isAvailable() {
+        return this.featureReferenceSelection.isAvailable();
+    }
 
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureReferenceSelection.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureReferenceSelection.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeatureReferenceSelection.java	(revision 44435)
@@ -38,6 +38,7 @@
 import org.gvsig.fmap.dal.feature.FeatureReferenceSelection;
 import org.gvsig.fmap.dal.feature.FeatureStore;
 import org.gvsig.fmap.dal.feature.FeatureStoreNotification;
+import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.dal.feature.impl.undo.FeatureCommandsStack;
 import org.gvsig.tools.ToolsLocator;
 import org.gvsig.tools.dispose.impl.AbstractDisposable;
@@ -65,6 +66,8 @@
 	public static final String DYNCLASS_PERSISTENT_NAME =
 			"DefaultFeatureReferenceSelection";
 
+    private Boolean available = null;
+    
     protected SelectionData selectionData = null;
 
     private FeatureStore featureStore;
@@ -612,4 +615,19 @@
 		// featureStore and helper are already swallow cloned by our parent
 		return clone;
 	}
+
+    @Override
+    public boolean isAvailable() {
+        if( this.available==null ) {
+            try {
+                FeatureType type = this.featureStore.getDefaultFeatureType();
+                this.available = type.supportReferences();
+            } catch (DataException ex) {
+                this.available = false;
+            }
+        }
+        return this.available;
+    }
+        
+        
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretable/table/DefaultFeatureTableModel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretable/table/DefaultFeatureTableModel.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretable/table/DefaultFeatureTableModel.java	(revision 44435)
@@ -557,6 +557,9 @@
     }
 
     public boolean isSelectionLocked() {
+        if( !this.getFeatureType().supportReferences() ) {
+            return true;
+        }
         return selectionLocked;
     }
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFetureStore.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFetureStore.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFetureStore.java	(revision 44435)
@@ -781,4 +781,9 @@
     public FeatureQuery createFeatureQuery(Expression filter, String sortBy, boolean asc) {
         return null;
     }
+
+    @Override
+    public boolean supportReferences() {
+        return true;
+    }
 }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFeatureType.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFeatureType.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/test/java/org/gvsig/fmap/dal/feature/DummyFeatureType.java	(revision 44435)
@@ -123,6 +123,16 @@
     }
 
     @Override
+    public boolean hasPrimaryKey() {
+        return false;
+    }
+
+    @Override
+    public boolean supportReferences() {
+        return false;
+    }
+    
+    @Override
     public FeatureAttributeDescriptor getDefaultGeometryAttribute() {
         return null;
     }
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureSelection.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureSelection.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureSelection.java	(revision 44435)
@@ -86,4 +86,6 @@
      * @return if it is selected
      */
     boolean isSelected(Feature feature);
+    
+    boolean isAvailable();
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureReferenceSelection.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureReferenceSelection.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureReferenceSelection.java	(revision 44435)
@@ -107,4 +107,6 @@
      * @return the iterator of selected feature references
      */
     Iterator referenceIterator();
+    
+    public boolean isAvailable();
 }
\ No newline at end of file
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureType.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureType.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureType.java	(revision 44435)
@@ -281,6 +281,10 @@
      */
     public FeatureAttributeDescriptor[] getPrimaryKey();
 
+    public boolean hasPrimaryKey();
+    
+    public boolean supportReferences();
+    
     /**
      * Returns the default geometry FeatureAttributeDescriptor. Return null if
      * it's not set
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureStore.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureStore.java	(revision 44434)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/feature/FeatureStore.java	(revision 44435)
@@ -1208,4 +1208,12 @@
     public long getPendingChangesCount();
     
     public Feature getSampleFeature();
+    
+    /**
+     * Return true when the default feature type of the store 
+     * support references.
+     * 
+     * @return true when support references.
+     */
+    public boolean supportReferences();
 }
