You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DQL queries including bidirectional one-to-one relations break with an exception as BasicEntityPersister#loadOneToOne assumes that such relations consist of a single join column since a360da5 as ClassMetadataInfo#getFieldForColumn breaks if an association mapping has more than one column.
Current behavior
Queries as shown in my failing testcase fail with the following exception on 2.6:
Doctrine\ORM\Mapping\MappingException: Cannot find a field on 'Doctrine\Tests\Functional\OneToOneReference' that is mapped to column 'objectId'. Either the field does not exist or an association exists but it has multiple join columns.
/home/ma27/Projects/orm/lib/Doctrine/ORM/Mapping/MappingException.php:621
/home/ma27/Projects/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php:2961
/home/ma27/Projects/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php:805
/home/ma27/Projects/orm/lib/Doctrine/ORM/UnitOfWork.php:2708
/home/ma27/Projects/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:271
/home/ma27/Projects/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:492
/home/ma27/Projects/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:162
/home/ma27/Projects/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php:152
/home/ma27/Projects/orm/lib/Doctrine/ORM/AbstractQuery.php:976
/home/ma27/Projects/orm/lib/Doctrine/ORM/AbstractQuery.php:922
/home/ma27/Projects/orm/lib/Doctrine/ORM/AbstractQuery.php:726
/home/ma27/Projects/orm/tests/Doctrine/Tests/ORM/Functional/OneToOneWithMultipleJoinColumnsTest.php:43
How to reproduce
I created a failing testcase in my fork which passes on 2.5, but fails on 2.6.
I didn't test it on master as it misses the method Doctrine\ORM\Persisters\Entity\BasicEntityPersister#loadOneToOneEntity. I assume that 3.0/master is too far diverged from 2.6, so a reproduction on master will be way harder.
Expected behavior
That the $qb->getQuery()->getResult() (see my example) resolves to an entity and doesn't break with an exception.
The text was updated successfully, but these errors were encountered:
This reverts a small change to Doctrine\ORM\Persisters\Entity\BasicEntityPersister
which caused one-to-one relations with an @JoinColumns annotation to break.
See doctrine#7579 for more information.
Bug Report
Summary
DQL queries including bidirectional one-to-one relations break with an exception as
BasicEntityPersister#loadOneToOne
assumes that such relations consist of a single join column since a360da5 asClassMetadataInfo#getFieldForColumn
breaks if an association mapping has more than one column.Current behavior
Queries as shown in my failing testcase fail with the following exception on 2.6:
How to reproduce
I created a failing testcase in my fork which passes on
2.5
, but fails on2.6
.I didn't test it on master as it misses the method
Doctrine\ORM\Persisters\Entity\BasicEntityPersister#loadOneToOneEntity
. I assume that 3.0/master is too far diverged from 2.6, so a reproduction on master will be way harder.Expected behavior
That the
$qb->getQuery()->getResult()
(see my example) resolves to an entity and doesn't break with an exception.The text was updated successfully, but these errors were encountered: