[DDC-1771] CLI generation of proxies for abstract STI base classes Created: 05/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.2.0-RC1
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Minor
Reporter: Brent Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

When I use the CLI tool to generate proxies manually (orm:generate-proxies), a proxy is generated for the abstract entity below, but this proxy is not declared abstract itself. The entity contains abstract methods, and the proxy obviously does not implement these methods, so it, too, must be declared abstract. Because it is not, the next time I try to generate proxies in this manner, I receive a PHP Fatal error:

Class Proxies_CG_\Ranking\AbstractRule contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Ranking\AbstractRule::myAbstractMethod)

My workaround is to delete this proxy first and then regenerate. While a minor inconvenience at this point, it would be great if the proxy generation code could mark proxies as abstract when necessary to avoid these errors.

Thank you.

– Entity

/**

  • @Entity
  • @InheritanceType("SINGLE_TABLE")
  • @DiscriminatorColumn(name="ranking_rule_type_id", type="integer")
  • @DiscriminatorMap( { * 1 = "ConcreteRuleOne", * 2 = "ConcreteRuleTwo", * 3 = "ConcreteRuleThree" * }

    )

  • @Table(name="ranking_rules")
    */
    abstract class AbstractRule
    {

– Generated proxy

/**

  • THIS CLASS WAS GENERATED BY THE DOCTRINE ORM. DO NOT EDIT THIS FILE.
    */
    class AbstractRule extends \Ranking\AbstractRule implements \Doctrine\ORM\Proxy\Proxy
    {


 Comments   
Comment by Benjamin Eberlei [ 07/Apr/12 ]

Fixed

Comment by Brent [ 07/Apr/12 ]

Thank you, sir.





[DDC-1534] ManyToMany Bidirectional Relationships require a defined "joinTable" Created: 13/Dec/11  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: Git Master
Fix Version/s: 2.2.2

Type: Bug Priority: Minor
Reporter: Jonathan Dell Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

In the Mapping when defining a ManyToMany Bi-Directional Association the inversedBy is required on the owning side. Without a joinTable defined, the inversedBy attribute is never read. The joinTable attribute should not be required if using the Mapping Defaults.

A quick glance at the code showed this in Annotations/XML/YML mappings



 Comments   
Comment by Benjamin Eberlei [ 17/Dec/11 ]

I don't get it, can you point me to some lines?

Comment by Benjamin Eberlei [ 07/Apr/12 ]

Found, fixed.





[DDC-1763] Fixing a bug when calling setDiscriminatorMap from multiple sources (ie: from Events::loadClassMetadata and annotation). Created: 04/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.1.6, 2.2, Git Master
Fix Version/s: 2.1.7, 2.2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Matyas Somfai Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: None


 Description   

We tried to set discriminator map in https://github.com/Netpositive/NetpositiveDiscriminatorMapBundle both from Events::loadClassMetadata and annotation.

Pull request created on 2.1.x, 2.2, master branches.



 Comments   
Comment by Peter Buri [ 05/Apr/12 ]

Pull requests:

https://github.com/doctrine/doctrine2/pull/326
https://github.com/doctrine/doctrine2/pull/327
https://github.com/doctrine/doctrine2/pull/328





[DDC-1764] [GH-326] 2.1.x setDiscriminatorMap fix Created: 04/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.7, 2.2.2, 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of smatyas:

Url: https://github.com/doctrine/doctrine2/pull/326

Message:

Fixing a bug when calling setDiscriminatorMap from multiple sources (ie: from Events::loadClassMetadata and annotation).

http://www.doctrine-project.org/jira/browse/DDC-1763



 Comments   
Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-327] was opened
https://github.com/doctrine/doctrine2/pull/327

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-328] was opened
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 04/Apr/12 ]

A related Github Pull-Request [GH-328] was synchronize
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 06/Apr/12 ]

A related Github Pull-Request [GH-328] was synchronize
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-327] was synchronize
https://github.com/doctrine/doctrine2/pull/327

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-328] was synchronize
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-327] was closed
https://github.com/doctrine/doctrine2/pull/327

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-328] was closed
https://github.com/doctrine/doctrine2/pull/328

Comment by Benjamin Eberlei [ 07/Apr/12 ]

A related Github Pull-Request [GH-326] was closed
https://github.com/doctrine/doctrine2/pull/326





[DDC-1766] Reintroduce old result cache as hydration cache Created: 04/Apr/12  Updated: 07/Apr/12  Resolved: 07/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.2.2, 2.3
Security Level: All

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

The old result cache should be reintroduced as hydration cache, since it obviously is much faster than just result caching by avoiding hydration.

        $users = $this->_em->createQuery($dql)
                      ->setHydrationCacheProfile(new QueryCacheProfile(null, null, $cache))
                      ->getResult();


 Comments   
Comment by Benjamin Eberlei [ 07/Apr/12 ]

Implemented Hydration Cache.





[DDC-1705] BasicEntityPersister throws error undefined index Created: 15/Mar/12  Updated: 01/Apr/12  Resolved: 01/Apr/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.2
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: victor Velkov Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 1
Labels: None


 Description   

In the BasicEntityPersister in the _getInsertSQL function when you are foreaching the columns you make a check

if (isset($this->_columnTypes[$column]) &&
                        isset($this->_class->fieldMappings[$this->_class->fieldNames[$column]]['requireSQLConversion'])) {
                        $type = Type::getType($this->_columnTypes[$column]);
                        $placeholder = $type->convertToDatabaseValueSQL('?', $this->_platform);
                    }

the problem is in

  isset($this->_class->fieldMappings[$this->_class->fieldNames[$column]]['requireSQLConversion'])

because you are not checking if it is set

$this->_class->fieldNames[$column]

i got that problem when was saving ManyToOne association



 Comments   
Comment by Sascha Nordquist [ 19/Mar/12 ]

I got the same error and used error handling to throw an exception of this notice:

===================
PHP Fatal error: Uncaught exception 'ErrorException' with message 'Undefined index: currentPrice_id' in /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php:1146
Stack trace:
#0 /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(1146): exception_error_handler(8, 'Undefined index...', '/usr/share/php/...', 1146, Array)
#1 /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php(225): Doctrine\ORM\Persisters\BasicEntityPersister->_getInsertSQL()
#2 /usr/share/php/Doctrine/ORM/UnitOfWork.php(896): Doctrine\ORM\Persisters\BasicEntityPersister->executeInserts()
#3 /usr/share/php/Doctrine/ORM/UnitOfWork.php(304): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#4 /usr/share/php/Doctrine/ORM/EntityManager.php(355): Doctrine\ORM\UnitOfWork->commit(NULL)
#5 /var/www/app/module/Application/src/Application/Entity/Model.php(29): Doctrine\ORM\EntityManager->flush()
#6 /var/www/app/module/Application/src/Application/Entity/ in /usr/share/php/Doctrine/ORM/Persisters/BasicEntityPersister.php on line 1146

===================

My mappings look like this:

/**

  • @ORM\OneToMany(targetEntity="Price", mappedBy="product", cascade= {"all"})
    * @ORM\OrderBy({"date" = "DESC"})
    */
    protected $prices;

    /**
    * @ORM\ManyToOne(targetEntity="Price", inversedBy="currentProducts",cascade={"all"}

    )
    */
    protected $currentPrice;

Comment by Benjamin Eberlei [ 01/Apr/12 ]

Fixed





[DDC-1648] Primary Keys as Foreign Keys - still not working in Reverse Engineering in 2.1.6 Created: 12/Feb/12  Updated: 14/Mar/12  Resolved: 14/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.1.6
Fix Version/s: 2.1.7, 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: ross neacoders Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Please, read this old thread - looks like this problem still is not solved

http://comments.gmane.org/gmane.comp.php.symfony.symfony2/1398

>>The primary key as foreign key limitation is from the 2.0 manual. You are using 2.1 with symfony, which supports this. Please use the correct manual.

>> The only problem is that the reverse engineering does not support this. You have to reverse engineer yourself, or write a patch to have Doctrine support this. I would really appreciate it

As I understand it is supported in the "core", but some reverse engineer script is still not using that possibility.
Could you at least point where this can fixed?



 Comments   
Comment by Benjamin Eberlei [ 12/Feb/12 ]

In lib/Doctrine/ORM/Mapping/DatabaseDriver.php

Comment by ross neacoders [ 12/Feb/12 ]

Thank you Benjamin,

Actually started tracking this error from /lib/Doctrine/ORM/Mapping/ClasMetadataInfo.php and step-bystep it goes to
/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php

Actually it calls ClasMetadataInfo::mapMayToOne instead of mapOneToOne in such situations.
Will investigate further. Pff... DatabaseDriver.php looks a hard class.

Comment by ross neacoders [ 12/Feb/12 ]

I am almost done with it - need a little more help from you:

So I fixed the DatabaseDriver so it correctly calls mapOneToOne
and passes association_mapping to it.

    /**
     * Adds a one-to-one mapping.
     *
     * @param array $mapping The mapping.
     */
    public function mapOneToOne(array $mapping)
    {
        $mapping['type'] = self::ONE_TO_ONE;
        $mapping = $this->_validateAndCompleteOneToOneMapping($mapping);
        $this->_storeAssociationMapping($mapping);
print_r($assocMapping); <--added this to see what structure we have on output
    }

this gives the following structure

Array
(
    [fieldName] => someguid                      <--- my primary key field, which is also foreign key
    [targetEntity] => Additionalinfo               <--- target table
    [id] => 1                                                      <--- indicates that this mapping is also id (primary key)
    [joinColumns] => Array
        (
            [0] => Array
                (
                    [name] => Someguid                                                     <--- join columns
                    [referencedColumnName] => UniqueID                    
                )

        )

    [type] => 1  <-- indicates ONE-TO-ONE assoc mapping
    [mappedBy] => 
    [inversedBy] => 
    [isOwningSide] => 1
    [sourceEntity] => Sampledata
    [fetch] => 2
..... (i omit other data as not important)
)

Now the problem: in my entity I got the following

    /**
     * @var Additionalinfo
     *
     * @ORM\OneToOne(targetEntity="Additionalinfo")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="Someguid", referencedColumnName="UniqueID")
     * })
     */
    private $someguid;

So it correctly created a One-To-One mapping, but it did not preserve @Id attribute.

I guess this is because field_associations and mapping_associations are processed in separate way,
and in mapping_association it ignores the $mapping["id"] setting.

Do you know what code is managing creating the <id ....> / @Id staff - it is common for annotation/yaml/xml, e.x. when i generated xml for entity, it also does not contain <id > tag.

Comment by ross neacoders [ 12/Feb/12 ]

Update: fixed the last problem in Doctrine/ORM/Tools/EntityGenerator.php

Still has to be fixed in YAML/XML exporters - not very familiar with the syntax.

Comment by Benjamin Eberlei [ 03/Mar/12 ]

This PR fixes the problem https://github.com/doctrine/doctrine2/pull/280

Comment by Benjamin Eberlei [ 14/Mar/12 ]

Fixed





[DDC-1692] doctrine:mapping:convert on entities without primary key Created: 09/Mar/12  Updated: 14/Mar/12  Resolved: 14/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Tools
Affects Version/s: 2.1.6
Fix Version/s: 2.2.2

Type: Bug Priority: Minor
Reporter: david Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu Server, PHP: 5.3.6-13ubuntu3.6, Symfony 2.0.11



 Description   

It issn't possible to use some of the Doctrine tools on entities without primary key.
Following error appears:

PHP Fatal error: Call to a member function getColumns() on a non-object in /media/sf_webdev-shared/Symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php on line 133

DatabaseDriver tries to get primary key columns without checking if there is any primary key.



 Comments   
Comment by Benjamin Eberlei [ 14/Mar/12 ]

Fixed, now throwing an exception.

Tables without primary keys are not supported by DatabaseDriver.





[DDC-1683] Doctrine\ORM\Query\Expr\Comparison Doesn't handle boolean values properly Created: 06/Mar/12  Updated: 14/Mar/12  Resolved: 14/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL, ORM
Affects Version/s: 2.1.6, 2.2
Fix Version/s: 2.1.7, 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Peter Mitchell Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Symfony 2.0.11, MySQL, PDO, PHP Version 5.3.5-1ubuntu7.7



 Description   

Expected behaviour - Using boolean types in Query Builder

The following works

$qb = $this->getDoctrine()->getEntityManager()->createQueryBuilder();

$qb
    ->select('entity')
    ->from('FooBundle:Entity', 'entity')
    ->where($qb->expr()->eq('entity.visible', true))
;

$query = $qb->getQuery();

return $query->getResult();

The following throws an Doctrine/ORM/Query/QueryException error [Syntax Error] line 0, col -1: Error: Expected Literal, got end of string.

$qb = $this->getDoctrine()->getEntityManager()->createQueryBuilder();

$qb
    ->select('entity')
    ->from('FooBundle:Entity', 'entity')
    ->where($qb->expr()->eq('entity.visible', false))
;

$query = $qb->getQuery();

return $query->getResult();

This is due to Doctrine\ORM\Query\Expr\Comparison::_toString()

public function __toString()
{
    return $this->_leftExpr . ' ' . $this->_operator . ' ' . $this->_rightExpr;
}

When $this->_rightExpr === true type coercion results in 1, but for false it results in an empty string, thus
resulting in invalid SQL.

The following in Doctrine\ORM\Query\Expr\Comparison::__construct() resolves the problem (https://github.com/doctrine/doctrine2/pull/297)

public function __construct($leftExpr, $operator, $rightExpr)
{
    $this->_leftExpr  = $leftExpr;
    $this->_operator  = $operator;
    $this->_rightExpr = $rightExpr === false ? (int) $rightExpr : $rightExpr;
}

Could be related to http://www.doctrine-project.org/jira/browse/DDC-1048 and http://www.doctrine-project.org/jira/browse/DDC-949



 Comments   
Comment by Benjamin Eberlei [ 14/Mar/12 ]

Fixed, but your code is wrong. It has to be

$qb->expr()->literal(true);




[DDC-1695] SQLs for PostgreSQL case sensite tables/fields are wrongly generated Created: 09/Mar/12  Updated: 11/Mar/12  Resolved: 11/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.1.6
Fix Version/s: 2.1.7, 2.2.2
Security Level: All

Type: Bug Priority: Blocker
Reporter: Ignacio Larranaga Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

PostgreSQL 9.x, Symfony 2


Attachments: Text File doctrine-2.1.6.patch     Text File SqlWalker.patch    

 Description   

The SQLs for case sensitive schemas in postgreSQL are wronly generated.

Example:
Schema:

CREATE TABLE "News" (
  "IdNews" serial NOT NULL,
  "IdUser" bigint NOT NULL,
  "IdLanguage" integer NOT NULL,
  "IdCondition" integer,
  "IdHealthProvider" integer,
  "IdSpeciality" integer,
  "IdMedicineType" integer,
  "IdTreatment" integer,
  "Title" character varying,
  "SmallText" character varying,
  "LongText" character varying,
  "PublishDate" timestamp with time zone,
  "IdxNews" tsvector,
  "Highlight" boolean NOT NULL DEFAULT false,
  "Order" integer NOT NULL DEFAULT 0,
  "Deleted" boolean NOT NULL DEFAULT false,
  "Active" boolean NOT NULL DEFAULT false,
  "UpdateToHighlighted" boolean DEFAULT false,
  CONSTRAINT "News_pkey" PRIMARY KEY ("IdNews" ));

Object (I added quotes trying to generate the SQLs quoted.:

<?php

namespace GlobalTreatments\ApplicationBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="""News""")
 * @ORM\Entity
 */
class News
{
    /**
     * @var integer $idNews
     *
     * @ORM\Column(name="""IdNews""", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="""News_IdNews_seq""", allocationSize="1", initialValue="1")
     */
    private $idNews;

    /**
     * @var bigint $iduser
     *
     * @ORM\Column(name="""IdUser""", type="bigint", nullable=false)
     */
    private $idUser;

    /**
     * @var integer $idLanguage
     *
     * @ORM\Column(name="""IdLanguage""", type="integer", nullable=false)
     */
    private $idLanguage;

    /**
     * @var integer $idCondition
     *
     * @ORM\Column(name="""IdCondition""", type="integer", nullable=true)
     */
    private $idCondition;

    /**
     * @var integer $idHealthProvider
     *
     * @ORM\Column(name="""IdHealthProvider""", type="integer", nullable=true)
     */
    private $idHealthProvider;

    /**
     * @var integer $idSpeciality
     *
     * @ORM\Column(name="""IdSpeciality""", type="integer", nullable=true)
     */
    private $idSpeciality;

    /**
     * @var integer $idMedicineType
     *
     * @ORM\Column(name="""IdMedicineType""", type="integer", nullable=true)
     */
    private $idMedicineType;

    /**
     * @var integer $idTreatment
     *
     * @ORM\Column(name="""IdTreatment""", type="integer", nullable=true)
     */
    private $idTreatment;

    /**
     * @var string $title
     *
     * @ORM\Column(name="""Title""", type="string", nullable=true)
     */
    private $title;

    /**
     * @var string $smallText
     *
     * @ORM\Column(name="""SmallText""", type="string", nullable=true)
     */
    private $smallText;

    /**
     * @var string $longText
     *
     * @ORM\Column(name="""LongText""", type="string", nullable=true)
     */
    private $longText;

    /**
     * @var datetimetz $publishDate
     *
     * @ORM\Column(name="""PublishDate""", type="datetimetz", nullable=true)
     */
    private $publishDate;

    /**
     * @var tsvector $idxNews
     *
     * @ORM\Column(name="""IdxNews""", type="tsvector", nullable=true)
     */
    private $idxNews;

    /**
     * @var boolean $highlight
     *
     * @ORM\Column(name="""Highlight""", type="boolean", nullable=false)
     */
    private $highlight;

    /**
     * @var integer $order
     *
     * @ORM\Column(name="""Order""", type="integer", nullable=false)
     */
    private $order;

    /**
     * @var boolean $deleted
     *
     * @ORM\Column(name="""Deleted""", type="boolean", nullable=false)
     */
    private $deleted;

    /**
     * @var boolean $active
     *
     * @ORM\Column(name="""Active""", type="boolean", nullable=false)
     */
    private $active;

    /**
     * @var boolean $updateToHighlighted
     *
     * @ORM\Column(name="""UpdateToHighlighted""", type="boolean", nullable=true)
     */
    private $updateToHighlighted;

    /**
     * @var condition
     *
     * @ORM\ManyToOne(targetEntity="Condition")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdCondition""", referencedColumnName="""IdCondition""")
     * })
     */
    private $condition;

    /**
     * @var healthProvider
     *
     * @ORM\ManyToOne(targetEntity="HealthProvider")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdHealthProvider""", referencedColumnName="""IdHealthProvider""")
     * })
     */
    private $healthProvider;

    /**
     * @var language
     *
     * @ORM\ManyToOne(targetEntity="Language")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdLanguage""", referencedColumnName="""IdLanguage""")
     * })
     */
    private $language;

    /**
     * @var medicineType
     *
     * @ORM\ManyToOne(targetEntity="MedicineType")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdMedicineType""", referencedColumnName="""IdMedicineType""")
     * })
     */
    private $medicineType;

    /**
     * @var speciality
     *
     * @ORM\ManyToOne(targetEntity="Speciality")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdSpeciality""", referencedColumnName="""IdSpeciality""")
     * })
     */
    private $speciality;

    /**
     * @var treatment
     *
     * @ORM\ManyToOne(targetEntity="Treatment")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdTreatment""", referencedColumnName="""IdTreatment""")
     * })
     */
    private $treatment;

    /**
     * @var user
     *
     * @ORM\ManyToOne(targetEntity="User")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="""IdUser""", referencedColumnName="""IdUser""")
     * })
     */
    private $user;

    ....

}

DQL:

'SELECT n.smallText, n.publishDate ' .
'FROM News n ' .
	'INNER JOIN n.language la ' .
'WHERE la.languageCode = :languageCode ' .
'ORDER BY n.publishDate DESC'

Generated SQL:

SELECT "0_."SmallText" AS "SmallText"0, "0_."PublishDate" AS "PublishDate"1 FROM "News" "0_ INNER JOIN "Language" "1_ ON "0_."IdLanguage" = "1_."IdLanguage" WHERE "1_."LanguageCode" = ? ORDER BY "0_."PublishDate" DESC LIMIT 6

Notice there are unmattched " in the SQL.



 Comments   
Comment by Ignacio Larranaga [ 09/Mar/12 ]

If there is another approach to specify the table/column names are case sensitive in PGSQL please let me know.

Comment by Ignacio Larranaga [ 09/Mar/12 ]

Just to comment. I also tried the normal quoting.

Example: @ORM\Column(name="`IdNews`", type="integer", nullable=false)

And does not work too because of the same reason.

Comment by Ignacio Larranaga [ 09/Mar/12 ]

Hi, I generate this patch and seems to be working for me (at least what I'm testing right now).

I used ยด to quote tables and single attributes (not relationships) and the SQLs are correctly generated.

Comment by Ignacio Larranaga [ 09/Mar/12 ]

Adding a new patch for another files I need to change.

Comment by Benjamin Eberlei [ 11/Mar/12 ]

Formatted code

Comment by Benjamin Eberlei [ 11/Mar/12 ]

Fixed and merged into 2.1.x and 2.2 branches





[DDC-1693] SqlWalker doesn't handle LockMode correctly Created: 11/Mar/12  Updated: 11/Mar/12  Resolved: 11/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.2-BETA1, 2.2-BETA2, 2.2.0-RC1, 2.2, 2.2.1, Git Master
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Major
Reporter: Billy Bednar Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Both issues are in SqlWalker::walkSelectStatement().
First is a typo on line 443 in master where LockMode::PESSIMISTIC_OPTIMISTIC is used instead of LockMode::OPTIMISTIC. This results in a fatal undefined class constant error.
Additionally, LockMode::NONE is not handled and results in an exception. An empty case will solve that issue.



 Comments   
Comment by Benjamin Eberlei [ 11/Mar/12 ]

Fixed, merged back into 2.2 branch.





[DDC-1629] short namespace in targetEntity dont work Created: 31/Jan/12  Updated: 03/Mar/12  Resolved: 03/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.2
Fix Version/s: 2.2.2
Security Level: All

Type: Bug Priority: Trivial
Reporter: Juan Enrique Escobar Robles Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 1
Labels: None


 Description   

in 2.1.x this work

/**

  • @ManyToOne(targetEntity="\Db:Cliente", cascade= {"ALL"})
    * @JoinColumn(name="cliente", referencedColumnName="telefono", nullable=false)
    * @var Db\modelo\Cliente
    */

    in 2.2 crash!

    PHP Fatal error: Uncaught exception 'Doctrine\\ORM\\Mapping
    MappingException' with message 'The target-entity Db:Cliente cannot be found in 'Lanzadora\\modelo
    Servicios#cliente'.' ....

    to use 2.2, i need update all Entities to this:

    /**
    * @ManyToOne(targetEntity="\Db\modelo\Cliente", cascade={"ALL"}

    )

  • @JoinColumn(name="cliente", referencedColumnName="telefono", nullable=false)
  • @var Db\modelo\Cliente
    */

why it change?, is bug or planned?

see DDC-1585 !!!



 Comments   
Comment by Benjamin Eberlei [ 03/Mar/12 ]

Iti shouldnt even work in 2.1, this is invalid.





Generated at Sun Apr 20 09:10:50 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.