diff --git a/src/Model/Behavior/Version/VersionTrait.php b/src/Model/Behavior/Version/VersionTrait.php
index <HASH>..<HASH> 100644
--- a/src/Model/Behavior/Version/VersionTrait.php
+++ b/src/Model/Behavior/Version/VersionTrait.php
@@ -37,11 +37,16 @@ trait VersionTrait
         }
 
         $table = TableRegistry::get($this->source());
-        $primaryKey = $table->primaryKey();
-
-        $conditions = [$primaryKey => $this->id];
-        $entities = $table->find('versions', ['conditions' => $conditions])
-                        ->all();
+        $primaryKey = (array)$table->primaryKey();
+
+        $query = $table->find('versions');
+        $pkValue = $this->extract($primaryKey);
+        $conditions = [];
+        foreach ($pkValue as $key => $value) {
+            $field = current($query->aliasField($key));
+            $conditions[$field] = $value;
+        }
+        $entities = $query->where($conditions)->all();
 
         if (empty($entities)) {
             return [];
Fixed bug in VersionTrait where primary key was hardcoded to $entity->id.