Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Invalid
-
Affects Version/s: 2.3.2
-
Fix Version/s: None
-
Component/s: ORM
-
Labels:None
-
Environment:debian 6, php 5.4.10
Description
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was:
/** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
$metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('SecretSecretBundle:Deal');
if (!array_key_exists('rolap', $metadata->getAssociationMappings())) {
// use a temporary join mapping
$metadata->mapOneToMany(array(
'targetEntity' => 'Secret\SecretBundle\Entity\RolapDealP1m',
'fieldName' => 'rolap',
'mappedBy' => 'deal',
));
}
A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class.
Then, a query using the queryBuilder was created like this:
$qb=$repo->createQueryBuilder('Deal');
$qb
->join('Deal.rolap', 'Rolap')
[additional joins]
->select(
array(
'Deal.number number',
'Deal.product productName',
[additional fields]
)
)
[additional where and group by]
;
The problem occurs, when doing a simple
$qb->getQuery()->getResult();
On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned.
On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs:
Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366
As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2.
We think there has been a regression when trying to create temporary mappings.
Activity
Marco Pivetta
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('QuantumSoptimBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Quantum\SoptimBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; The problem occurs, when doing a simple $qb->getQuery()->getResult(); On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there is has been a regression when trying to create temporary mappings. |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: {code} /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('QuantumSoptimBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Quantum\SoptimBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } {code} A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: {code} $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; {code} The problem occurs, when doing a simple {code} $qb->getQuery()->getResult(); {code} On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: {code} Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 {code} As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there is has been a regression when trying to create temporary mappings. |
Thomas Mayer
made changes -
| Description |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: {code} /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('QuantumSoptimBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Quantum\SoptimBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } {code} A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: {code} $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; {code} The problem occurs, when doing a simple {code} $qb->getQuery()->getResult(); {code} On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: {code} Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 {code} As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there is has been a regression when trying to create temporary mappings. |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('SecretSecretBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Secret\SecretBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; The problem occurs, when doing a simple $qb->getQuery()->getResult(); On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there is has been a regression when trying to create temporary mappings. |
Thomas Mayer
made changes -
| Description |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('SecretSecretBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Secret\SecretBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; The problem occurs, when doing a simple $qb->getQuery()->getResult(); On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there is has been a regression when trying to create temporary mappings. |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('SecretSecretBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Secret\SecretBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; The problem occurs, when doing a simple $qb->getQuery()->getResult(); On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there has been a regression when trying to create temporary mappings. |
Marco Pivetta
made changes -
| Description |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('SecretSecretBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Secret\SecretBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; The problem occurs, when doing a simple $qb->getQuery()->getResult(); On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there has been a regression when trying to create temporary mappings. |
After updating to from symfony 2.0 to symfony 2.1, creating a new mapping did not work when using \Doctrine\ORM\Mapping\ClassMetadata::mapOneToMany().
The code used was: {code} /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $this->getDoctrine()->getEntityManager()->getClassMetadata('SecretSecretBundle:Deal'); if (!array_key_exists('rolap', $metadata->getAssociationMappings())) { // use a temporary join mapping $metadata->mapOneToMany(array( 'targetEntity' => 'Secret\SecretBundle\Entity\RolapDealP1m', 'fieldName' => 'rolap', 'mappedBy' => 'deal', )); } {code} A manyToOne mapping from RolapDealP1m to Deal was already created in the RolapDealP1m entity class. Then, a query using the queryBuilder was created like this: {code} $qb=$repo->createQueryBuilder('Deal'); $qb ->join('Deal.rolap', 'Rolap') [additional joins] ->select( array( 'Deal.number number', 'Deal.product productName', [additional fields] ) ) [additional where and group by] ; {code} The problem occurs, when doing a simple {code} $qb->getQuery()->getResult(); {code} On symfony 2.0 using doctrine 2.2.2 it worked fine, the result was returned. On symfony 2.1 using doctrine 2.3.2 and 2.2.2 an error occurs: {code} Notice: Undefined index: rolap in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php line 366 {code} As a workaround, we added the OneToMany mapping to the Deal Entity instead of using a temporary mapping. This worked fine with symfony 2.1/doctrine 2.3.2. We think there has been a regression when trying to create temporary mappings. |
Benjamin Eberlei
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Invalid [ 6 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2324, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Please validate the generated mappings with Doctrine\ORM\Tools\SchemaValidator.php