diff --git a/data/src/main/java/org/xillium/data/persistence/crud/CrudCommand.java b/data/src/main/java/org/xillium/data/persistence/crud/CrudCommand.java
index <HASH>..<HASH> 100644
--- a/data/src/main/java/org/xillium/data/persistence/crud/CrudCommand.java
+++ b/data/src/main/java/org/xillium/data/persistence/crud/CrudCommand.java
@@ -195,6 +195,11 @@ public class CrudCommand {
 			}
 			keys.close();
 
+            // RETRIEVE is not compatible with tables without a primary key
+            if (primaryKeys.isEmpty() && action.op == Operation.RETRIEVE) {
+                throw new RuntimeException("Primary key expected for RETRIEVE command, but missing on table " + tablenames[i]);
+            }
+
             // ISA keys and table join conditions
 			Set<String> isaKeys = new HashSet<String>();
 			if (i > 0) {
reject RETRIEVE on tables w/o a primary key (like a view)