diff --git a/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php b/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php
index fc283fc..ebee8e4 100644
--- a/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php
+++ b/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php
@@ -797,26 +797,43 @@ class EntityFieldQuery {
     if (empty($this->entityConditions['entity_type'])) {
       throw new EntityFieldQueryException(t('For this query an entity type must be specified.'));
     }
+
     $entity_type = $this->entityConditions['entity_type']['value'];
     $entity_info = entity_get_info($entity_type);
     if (empty($entity_info['base table'])) {
       throw new EntityFieldQueryException(t('Entity %entity has no base table.', array('%entity' => $entity_type)));
     }
+
     $base_table = $entity_info['base table'];
-    $base_table_schema = drupal_get_schema($base_table);
+    $data_table = 'data';
+    $data_table_schema = array();
+
     $select_query = db_select($base_table);
     $select_query->addExpression(':entity_type', 'entity_type', array(':entity_type' => $entity_type));
+    $sql_field = $entity_info['entity keys']['id'];
+
+    // If a data table is defined we need to join it and make sure that only one
+    // record per entity is returned.
+    if (!empty($entity_info['data table'])) {
+      $table = $entity_info['data table'];
+      $data_table_schema = drupal_get_schema($table);
+      $select_query->innerJoin($table, $data_table, "$data_table.$sql_field = $base_table.$sql_field");
+      $select_query->distinct(TRUE);
+    }
+
     // Process the property conditions.
     foreach ($this->propertyConditions as $property_condition) {
-      $this->addCondition($select_query, $base_table . '.' . $property_condition['column'], $property_condition);
+      $column = $property_condition['column'];
+      $table = isset($data_table_schema['fields'][$column]) ? $data_table : $base_table;
+      $this->addCondition($select_query, "$table.$column", $property_condition);
     }
-    // Process the four possible entity condition.
+
+    // Process the six possible entity condition.
     // The id field is always present in entity keys.
-    $sql_field = $entity_info['entity keys']['id'];
     $id_map['entity_id'] = $sql_field;
     $select_query->addField($base_table, $sql_field, 'entity_id');
     if (isset($this->entityConditions['entity_id'])) {
-      $this->addCondition($select_query, $base_table . '.' . $sql_field, $this->entityConditions['entity_id']);
+      $this->addCondition($select_query, "$base_table.$sql_field", $this->entityConditions['entity_id']);
     }
 
     // If there is a revision key defined, use it.
@@ -824,7 +841,7 @@ class EntityFieldQuery {
       $sql_field = $entity_info['entity keys']['revision'];
       $select_query->addField($base_table, $sql_field, 'revision_id');
       if (isset($this->entityConditions['revision_id'])) {
-        $this->addCondition($select_query, $base_table . '.' . $sql_field, $this->entityConditions['revision_id']);
+        $this->addCondition($select_query, "$base_table.$sql_field", $this->entityConditions['revision_id']);
       }
     }
     else {
@@ -835,9 +852,9 @@ class EntityFieldQuery {
 
     // Handle bundles.
     if (!empty($entity_info['entity keys']['bundle'])) {
+      $base_table_schema = drupal_get_schema($base_table);
       $sql_field = $entity_info['entity keys']['bundle'];
       $having = FALSE;
-
       if (!empty($base_table_schema['fields'][$sql_field])) {
         $select_query->addField($base_table, $sql_field, 'bundle');
       }
@@ -847,10 +864,12 @@ class EntityFieldQuery {
       $select_query->addExpression(':bundle', 'bundle', array(':bundle' => $entity_type));
       $having = TRUE;
     }
+
     $id_map['bundle'] = $sql_field;
+
     if (isset($this->entityConditions['bundle'])) {
       if (!empty($entity_info['entity keys']['bundle'])) {
-        $this->addCondition($select_query, $base_table . '.' . $sql_field, $this->entityConditions['bundle'], $having);
+        $this->addCondition($select_query, "$base_table.$sql_field", $this->entityConditions['bundle'], $having);
       }
       else {
         // This entity has no bundle, so invalidate the query.
@@ -858,6 +877,15 @@ class EntityFieldQuery {
       }
     }
 
+    foreach (array('uuid', 'langcode') as $key) {
+      if (isset($this->entityConditions[$key])) {
+        $sql_field = !empty($entity_info['entity keys'][$key]) ? $entity_info['entity keys'][$key] : $key;
+        if (isset($base_table_schema[$sql_field])) {
+          $this->addCondition($select_query, "$base_table.$sql_field", $this->entityConditions[$key]);
+        }
+      }
+    }
+
     // Order the query.
     foreach ($this->order as $order) {
       if ($order['type'] == 'entity') {
@@ -868,7 +896,9 @@ class EntityFieldQuery {
         $select_query->orderBy($id_map[$key], $order['direction']);
       }
       elseif ($order['type'] == 'property') {
-        $select_query->orderBy($base_table . '.' . $order['specifier'], $order['direction']);
+        $specifier = $order['specifier'];
+        $table = isset($data_table_schema['fields'][$specifier]) ? $data_table : $base_table;
+        $select_query->orderBy("$table.$specifier", $order['direction']);
       }
     }
 
diff --git a/core/modules/entity/tests/modules/entity_test/entity_test.module b/core/modules/entity/tests/modules/entity_test/entity_test.module
index 02ec108..0980c85 100644
--- a/core/modules/entity/tests/modules/entity_test/entity_test.module
+++ b/core/modules/entity/tests/modules/entity_test/entity_test.module
@@ -14,6 +14,7 @@ function entity_test_entity_info() {
     'entity class' => 'Drupal\entity_test\EntityTest',
     'controller class' => 'Drupal\entity_test\EntityTestStorageController',
     'base table' => 'entity_test',
+    'data table' => 'entity_test_property_data',
     'fieldable' => TRUE,
     'entity keys' => array(
       'id' => 'id',
diff --git a/core/modules/entity/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php b/core/modules/entity/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php
index b31e5ce..b379644 100644
--- a/core/modules/entity/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php
+++ b/core/modules/entity/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php
@@ -21,43 +21,6 @@ use Drupal\entity\DatabaseStorageController;
 class EntityTestStorageController extends DatabaseStorageController {
 
   /**
-   * Overrides Drupal\entity\DatabaseStorageController::loadByProperties().
-   */
-  public function loadByProperties(array $values) {
-    $query = db_select($this->entityInfo['base table'], 'base');
-    $query->addTag($this->entityType . '_load_multiple');
-    if ($values) {
-      // Conditions need to be applied the property data table.
-      $query->addJoin('inner', 'entity_test_property_data', 'data', "base.{$this->idKey} = data.{$this->idKey}");
-      $query->distinct(TRUE);
-
-      // @todo We should not be using a condition to specify whether conditions
-      // apply to the default language or not. We need to move this to a
-      // separate parameter during the following API refactoring.
-      // Default to the original entity language if not explicitly specified
-      // otherwise.
-      if (!array_key_exists('default_langcode', $values)) {
-        $values['default_langcode'] = 1;
-      }
-      // If the 'default_langcode' flag is esplicitly not set, we do not care
-      // whether the queried values are in the original entity language or not.
-      elseif ($values['default_langcode'] === NULL) {
-        unset($values['default_langcode']);
-      }
-
-      $data_schema = drupal_get_schema('entity_test_property_data');
-      $query->addField('data', $this->idKey);
-      foreach ($values as $field => $value) {
-        // Check on which table the condition needs to be added.
-        $table = isset($data_schema['fields'][$field]) ? 'data' : 'base';
-        $query->condition($table . '.' . $field, $value);
-      }
-    }
-    $ids = $query->execute()->fetchCol();
-    return $ids ? $this->load($ids) : array();
-  }
-
-  /**
    * Overrides Drupal\entity\DatabaseStorageController::attachLoad().
    */
   protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
diff --git a/core/modules/field/modules/field_sql_storage/field_sql_storage.module b/core/modules/field/modules/field_sql_storage/field_sql_storage.module
index 69e8bda..27132b1 100644
--- a/core/modules/field/modules/field_sql_storage/field_sql_storage.module
+++ b/core/modules/field/modules/field_sql_storage/field_sql_storage.module
@@ -550,6 +550,7 @@ function field_sql_storage_field_storage_query(EntityFieldQuery $query) {
     }
   }
 
+  $entity_base_table = FALSE;
   if ($query->propertyConditions || $has_property_order) {
     if (empty($query->entityConditions['entity_type']['value'])) {
       throw new EntityFieldQueryException('Property conditions and orders must have an entity type defined.');
@@ -561,8 +562,31 @@ function field_sql_storage_field_storage_query(EntityFieldQuery $query) {
       $query->addCondition($select_query, "$entity_base_table." . $property_condition['column'], $property_condition);
     }
   }
+
+  // The entity base keys require joining the entity base table.
+  $entity_base_keys = array('langcode', 'uuid');
   foreach ($query->entityConditions as $key => $condition) {
-    $query->addCondition($select_query, "$field_base_table.$key", $condition);
+    $table = FALSE;
+    if (!in_array($key, $entity_base_keys)) {
+      $table = $field_base_table;
+    }
+    else {
+      // Join only if we did not already before.
+      if (empty($entity_base_table)) {
+        $entity_base_table = _field_sql_storage_query_join_entity($select_query, $entity_type, $field_base_table);
+      }
+      if (empty($entity_schema)) {
+        $entity_schema = drupal_get_schema($entity_base_table);
+      }
+      if (!empty($entity_schema['fields'][$key])) {
+        $table = $entity_base_table;
+      }
+    }
+    // Apply the condition only if we have a valid table: entity conditions may
+    // refer to non existing columns.
+    if ($table) {
+      $query->addCondition($select_query, "$table.$key", $condition);
+    }
   }
 
   // Order the query.
