[DDC-1698] Inconsistent proxy file name & namespace result in __PHP_Incomplete_Class when unserializing entities Created: 13/Mar/12 Updated: 06/Jan/13 |
|
| Status: | Reopened |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2, 2.2.1 |
| Fix Version/s: | 2.2.2 |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Benjamin Morel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Irrelevant |
||
| Description |
|
Starting with Doctrine 2.2, the Proxy classes have inconsistent naming with their file name, which raises problems with class autoloading. Application\Proxy\__CG__\Application\Model\User This class is located in the following file: Application/Proxy/__CG__ApplicationModelUser.php But whe we serialize such an entity, then unserialize it in another session, the framework autoloader expects the class to be located in: Application/Proxy/__CG__/Application/Model/User.php But it is not. I'm not sure whether this is an intended behavior, but I would assume this is a bug. |
| Comments |
| Comment by Benjamin Morel [ 13/Mar/12 ] |
|
It looks like there is an even broader problem with the new _CG_ prefix; the PSR-0 standard for autoloading states that the underscores should be handled this way: \namespace\package\Class_Name => {...}/namespace/package/Class/Name.php
Which means that in the above example, it could even expect the file to be located in: Application/Proxy///CG///Application/Model/User.php ... which is far away from the actual location. |
| Comment by Benjamin Eberlei [ 14/Mar/12 ] |
|
Proxy classes do not follow PSR-0. For the case unserializing objects we should provide an extra autoloader i guess. See here how symfony does it https://github.com/doctrine/DoctrineBundle/blob/master/DoctrineBundle.php#L57 |
| Comment by Benjamin Eberlei [ 14/Mar/12 ] |
|
See https://github.com/doctrine/doctrine2/commit/9b4d60897dfc7e9b165712428539e694ec596c80 and https://github.com/doctrine/orm-documentation/commit/01381fae1ff3d4944086c7cfe46721925bf6ca15 |
| Comment by Benjamin Morel [ 14/Mar/12 ] |
|
Thanks for the quick fix, Benjamin. You mentioned in the doc that the proxies are not PSR-0 compliant "for implementation reasons"; as this was working fine before 2.2, could you please explain what requirement prevents Doctrine from keeping the previous naming convention? |
| Comment by Benjamin Eberlei [ 29/Mar/12 ] |
|
In 2.1 the proxies are not PSR-0 compatible themselves, however their class naming is simpler. In 2.2 we changed proxy names so that you can derive the original name of the proxy by searching for the _CG_ flag. This flag obviously contains the __ chars that some PSR autoloaders detect as directory seperators. I agree this is an unfortunate decision, but it was done this way. I do think however that we can automatically register the proxy atuoloader (if not yet done) in EntityManager#create(). This would hide this fact from developers automatically. |
| Comment by Benjamin Morel [ 29/Oct/12 ] |
|
@Benjamin Eberlei |
| Comment by Benjamin Eberlei [ 06/Jan/13 ] |
|
Benjamin Morel Not at the moment, seems too dangerous for me since it might produce race conditions. This should really be done in the bootstrap of the system. We need to document this though. |
| Comment by Benjamin Morel [ 06/Jan/13 ] |
|
Ok, thanks for your answer! |
[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 /**
– Generated 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 |
[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 |
| Comment by Benjamin Eberlei [ 04/Apr/12 ] |
|
A related Github Pull-Request [GH-328] was opened |
| Comment by Benjamin Eberlei [ 04/Apr/12 ] |
|
A related Github Pull-Request [GH-328] was synchronize |
| Comment by Benjamin Eberlei [ 06/Apr/12 ] |
|
A related Github Pull-Request [GH-328] was synchronize |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-327] was synchronize |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-328] was synchronize |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-327] was closed |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-328] was closed |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-326] was closed |
[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: =================== =================== My mappings look like this: /**
|
| 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. |
| 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 Actually it calls ClasMetadataInfo::mapMayToOne instead of mapOneToOne in such situations. |
| 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 /**
* 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, 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.
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 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: |
|
| Description |
|
The SQLs for case sensitive schemas in postgreSQL are wronly generated. Example: 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(). |
| 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 /**
why it change?, is bug or planned? see |
| Comments |
| Comment by Benjamin Eberlei [ 03/Mar/12 ] |
|
Iti shouldnt even work in 2.1, this is invalid. |