diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php index 8245722a9..bde84579e 100644 --- a/lib/Doctrine/ORM/Query/QueryException.php +++ b/lib/Doctrine/ORM/Query/QueryException.php @@ -204,13 +204,15 @@ class QueryException extends \Doctrine\ORM\ORMException } /** + * @param object $pathExpr + * * @return QueryException */ - public static function associationPathInverseSideNotSupported() + public static function associationPathInverseSideNotSupported($pathExpr) { return new self( - "A single-valued association path expression to an inverse side is not supported". - " in DQL queries. Use an explicit join instead." + "A single-valued association path expression to an inverse side is not supported in DQL queries. " . + "Instead of '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "' use an explicit join." ); } diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index a4b5089e8..269859528 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -671,7 +671,7 @@ class SqlWalker implements TreeWalker $assoc = $class->associationMappings[$fieldName]; if ( ! $assoc['isOwningSide']) { - throw QueryException::associationPathInverseSideNotSupported(); + throw QueryException::associationPathInverseSideNotSupported($pathExpr); } // COMPOSITE KEYS NOT (YET?) SUPPORTED