$definition->
isVersionAware() ? 'AND #reference#.#entity_version_id# = #root#.version_id' : '',
$definition->
isVersionAware() ? 'AND #root#.version_id = :version' : ''
);
$parameters =
[ '#root#' => EntityDefinitionQueryHelper::
escape($definition->
getEntityName()),
'#entity_id#' => EntityDefinitionQueryHelper::
escape($foreignKey),
'#entity_version_id#' => EntityDefinitionQueryHelper::
escape($versionKey),
'#property#' => EntityDefinitionQueryHelper::
escape($association->
getPropertyName()),
'#reference#' => EntityDefinitionQueryHelper::
escape($reference->
getEntityName()),
];