[DDC-2332] [UnitOfWork::doPersist()] The spl_objact_hash() generate not unique hash! Created: 05/Mar/13 Updated: 01/Apr/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Critical |
| Reporter: | Krisztián Ferenczi | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symfony 2.1.8, php 5.4.7 and php 5.4.12, Windows 7 |
||
| Attachments: |
|
| Description |
|
I created fixtures and some data was inserted many times without calling the Task entity PrePersist event listener. I printed the used and generated hash and I saw a Proxies_CG_\Asitly\ProjectManagementBundle\Entity\User hash equal a Task entity hash! |
| Comments |
| Comment by Marco Pivetta [ 05/Mar/13 ] |
|
Please provide either a code example or a test case. As it stands, this issue is incomplete |
| Comment by Benjamin Eberlei [ 05/Mar/13 ] |
|
Are you calling EntityManager#clear() inbetween? Because PHP reuses the hashes. The ORM accounts for this. |
| Comment by Benjamin Eberlei [ 05/Mar/13 ] |
|
This is not a reproduce case, i don't want to execute your whole project. I want to know, what is the actual bug that you see? Can you just print a list of all the hashes? Because the hashes dont differ at the end, bu tjust somewhere in the middle. |
| Comment by Krisztián Ferenczi [ 05/Mar/13 ] |
|
I attached a hashlogs.txt file. The last Task class hash is 0000000050ab4aba0000000058e1cb12 ( line 3 129 ) This is not unique, view the line 2 760 . The Task is not being saved and the program don't call the prePersist listener. The "UnitOfWork" believe the entity has been saved because the isset($this->entityStates[$oid]) is true. But it is an other entity. |
| Comment by Krisztián Ferenczi [ 06/Mar/13 ] |
|
The EntityManager::clear() fix the problem, but this is not "good" and "beautiful" solution. Shows no sign of that conflicts were and this is causing the problem. I was looking for the problem 7 hours. |
[DDC-2237] oracle IN statement with more than 1000 values Created: 11/Jan/13 Updated: 02/Apr/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Critical |
| Reporter: | Marc Drolet | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
If I have a query with a IN statement with more tahn 1000 values I get an sql error. I've try IN with implode: |
| Comments |
| Comment by Marc Drolet [ 11/Jan/13 ] |
|
Here is the way I've implement the solution on my side: (for oracle) into Doctrine/DBAL/Statement.php, I've add this method:
/**
* Binds a parameter value to the statement.
* This is implemented this way for oracle only. Other drivers are redirected to bindValue method.
*
* The value will be bound with to the type provided (that required to be a table type).
*
* @param String $name The name or position of the parameter.
* @param Array $value The value of the parameter.
* @param String $type The name of the type to use to bind.
* @return boolean TRUE on success, FALSE on failure.
*/
public function bindList($name, Array $value, $type)
{
if ('oracle' !== $this->platform->getName())
{
$this->bindValue($name, $value, $type);
}
else
{
return $this->stmt->bindList($name, $value, $type);
}
}
into Doctrine/DBAL/Driver/Statement.php I've add:
/**
* @TODO: docs
*/
function bindList($param, Array $values, $type);
into Doctrine/DBAL/Driver/OCI8/OCI8Statement.php I've add this method:
/**
* {@inheritdoc}
*/
public function bindList($param, Array $value, $type)
{
if (!($list = oci_new_collection($this->_dbh, $type)))
{
//throw new OCI8Exception::fromErrorInfo($this->errorInfo());
}
foreach ($value as $entry)
{
$list->append($entry);
}
if (!oci_bind_by_name($this->_sth, $param, $list, -1, OCI_B_NTY))
{
//throw new OCI8Exception::fromErrorInfo($this->errorInfo());
}
}
// NOTE: we should probably add the bindList to all driver Statement object. into your code you can use it this way:
$sql = "
SELECT *
FROM test
WHERE id IN
(
SELECT *
FROM
(
CAST (: p_ids AS list_int_type)
)
)
";
$stmt = connection->prepare($sql);
$stmt->bindList(': p_ids', $ids, 'list_int_type');
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
NOTE: create or replace type list_str_type as table of varchar2(4000); |
| Comment by Benjamin Eberlei [ 01/Apr/13 ] |
|
Hey Marc Drolet thanks for the feedback and the solution, however i would like to have something generic that is working independent of the database driver. This code is very specific. Can you point me to some documentation why oci collection works with more than 1000 elements and how it works in PHP? |
| Comment by Marc Drolet [ 02/Apr/13 ] |
|
Hi Benjamin, The limitation is not from the oci driver, it's an oracle limitation. There are a couple of possible solution/implementation that can be done but the one I've provide is the one that perform better for the test I've done and from what I can found over the blogs I've read. I can't find the exact documentation of oracle. oracle doc is so poor. I don't know if there is similar limitation with other database. With the implementation I've provided, It will be possible to implement the proper solution depending on the database limitation you face otherwise it will execute the generic IN. What's bad, we need to create the type into the database. NOTE: In my case, I can not perform a sub-query, I get the my collection from a web service call. |
[DDC-2441] Incorrect SQL Query being generated Created: 09/May/13 Updated: 09/May/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL |
| Affects Version/s: | 2.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Critical |
| Reporter: | Paul Mansell | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Using Doctrine in Symfony 2.2.1 on Windows Platform |
||
| Description |
|
The following DQL : SELECT s,ba,c,mno,ss,sws,ccs,cns,cws FROM WLCoreBundle:SIM s INNER JOIN s.billingAccount ba LEFT JOIN s.connection c INNER JOIN s.status ss LEFT JOIN s.workflowStatus sws INNER JOIN c.customerStatus ccs INNER JOIN c.networkStatus cns LEFT JOIN c Produces the following SQL : SELECT * FROM (SELECT c0_.id AS id0, c0_.iccid AS iccid1, c0_.created AS created2, c0_.updated AS updated3, c0_.spreference AS spreference4, c1_.id ASid5, c1_.account_number AS account_number6, c1_.name AS name7, c1_.address1 AS address18, c1_.address2 AS address29, c1_.address3 AS address310, c1_.address4 AS address411, c1_.address5 AS address512, c1_.address6 AS address613, c1_.email_address AS email_address14, c1_.spreference AS spreference15, c2_.id AS id16, c2_.msisdn AS msisdn17, c2_.local AS local18, c2_.imsi AS imsi19, c2_.data AS data20, c2_.fax AS fax21, c2_.api AS api22, c2_.activation_date AS activation_date23, c2_.contract_end_date AS contract_end_date24, c2_.created AS created25, c2_.updated AS updated26, c2_.spreference AS spreference27, c3_.id AS id28, c3_.ident AS ident29, c3_.label AS label30, c3_.description AS description31, c4_.id AS id32, c4_.ident AS ident33, c4_.label AS label34, c4_.description AS description35, c4_.customer_label AS customer_label36, c4_.customer_description AS customer_description37, c5_.id AS id38, c5_.ident AS ident39, c5_.label AS label40, c5_.description AS description41, c6_.id AS id42, c6_.ident AS ident43, c6_.label AS label44, c6_.description AS description45, c7_.id AS id46, c7_.ident AS ident47, c7_.label AS label48, c7_.description AS description49, c7_.customer_label AS customer_label50, c7_.customer_description AS customer_description51, c8_.id AS id52, c8_.name AS name53, c8_.email_address AS email_address54, c8_.is_active AS is_active55, c8_.spreference AS spreference56, c0_.billing_account AS billing_account57, c0_.customerHierarchy AS customerHierarchy58, c0_.mno AS mno59, c0_.status AS status60, c0_.workflow_status AS workflow_status61, c1_.customer_hierarchy AS customer_hierarchy62, c1_.country AS country63, c1_.tax_rate AS tax_rate64, c1_.currency AS currency65, c1_.status AS status66, c1_.priority AS priority67, c2_.sim AS sim68, c2_.customer_status AS customer_status69, c2_.network_status AS network_status70, c2_.workflow_status AS workflow_status71, ROW_NUMBER() OVER (ORDER BY msisdn17 ASC) AS doctrine_rownum FROM core_sim c0_ WITH (NOLOCK) INNER JOIN core_billing_account c1_ ON c0_.billing_account = c1_.id LEFT JOIN core_connection c2_ ON c0_.id = c2_.sim INNER JOIN core_sim_status c3_ ON c0_.status = c3_.id LEFT JOIN core_sim_workflow_status c4_ ON c0_.workflow_status = c4_.id INNER JOIN core_connection_customer_status c5_ ON c2_.customer_status = c5_.id INNER JOIN core_connection_network_status c6_ ON c2_.network_status = c6_.id LEFT JOIN core_connection_workflow_status c7_ ON c2_.workflow_status = c7_.id INNER JOIN core_mno c8_ ON c0_.mno = c8_.id) AS doctrine_tbl WHERE doctrine_rownum BETWEEN 1 AND 10 Which returns an error : SQLSTATE[42S22]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid column name 'msisdn17'. Same query works fine in Doctrine 2.3 |
[DDC-813] Validate Schema should complain on bi-directional relationships with mapped superclasses Created: 21/Sep/10 Updated: 29/Oct/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Tools |
| Affects Version/s: | 2.0-BETA4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
@ManyToOne and @OneToOne on mapped superclasses have to be unidirectional. The Schema Validator should verify this. |
[DDC-1285] Select by multiple ids Created: 22/Jul/11 Updated: 11/Jan/13 |
|
| Status: | In Progress |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers, ORM |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Serge Smertin | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
How do you look at adding findByIds(array $ids) to EntityManager and UnitOfWork? This would allow fetching multiple entities from a database at one request and would be very useful for caching - there would be even some kind of IdentityMap kept in memcached or any other caching engine, that supports multiple id retrieval: i've been using such an architecture in multiple projects and it turned out to be very effective. There were two basic methods - findIdsByFilter(array $filter) and findEntitiesByIds(array $ids). The latter one had a caching proxy, replicating entities to a cache storage. If this idea proceeds - I'd be glad to cover it with more details. This topic on StackOverflow could also help: |
| Comments |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
[DDC-1270] Incorrect QueryBuilder example Created: 11/Jul/11 Updated: 11/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Alex Bogomazov | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In the QueryBuilder section of the documentation (http://www.doctrine-project.org/docs/orm/2.1/en/reference/query-builder.html#the-expr-class) there's an example with statements like
$qb->expr()->select('u')
But this doesn't work anymore. |
| Comments |
| Comment by Michael Ridgway [ 11/Jul/11 ] |
[DDC-1269] Unexpected behavior while using association on a non primary key field Created: 11/Jul/11 Updated: 13/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Alexandr Torchenko | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
We have association on non primary key. Something like this: Entities\Payment:
type: entity
table: payments
fields:
id:
id: true
type: integer
nullable: false
generator:
strategy: IDENTITY
[-- skipped --]
manyToOne:
order:
targetEntity: Entities\Order
inversedBy: payments
joinColumn:
name: scode
referencedColumnName: scode
Entities\Order:
type: entity
table: h_orders
fields:
id:
id: true
type: integer
unsigned: false
nullable: false
generator:
strategy: IDENTITY
scode:
type: integer
unsigned: false
nullable: false
[-- skipped --]
oneToMany:
payments:
targetEntity: Entities\Payment
mappedBy: order
When I try to fetch Order from Payment with lazy loading I receive empty Order object with null properties. If I use eager fetching Order object is valid. Another problem appears while persisting new Payment. $payment = new \Entities\Payment(); ... $order = $this->em->getRepository('\Entities\Order')->find(46320); $payment->setOrder($order); $order->addPayments($payment); $this->em->persist($payment); $this->em->flush(); I get this error: Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'scode' cannot be null' in /usr/share/php/Doctrine/DBAL/Statement.php:131 I found issue which is still open and looks like mine – http://www.doctrine-project.org/jira/browse/DDC-1114. What do you think about this? |
| Comments |
| Comment by Benjamin Eberlei [ 12/Jul/11 ] |
|
Formatting, please add a second ticket for the second issue. |
| Comment by Benjamin Eberlei [ 12/Jul/11 ] |
|
I don't think its supported to use a non primary id for foreign key matching. I cant tell for sure though since i wasnt responsible to design this part of the Doctrine code. I would strongly suggest not to do this. |
| Comment by Benjamin Eberlei [ 12/Jul/11 ] |
|
Marked as improvement. The problem is we cannot detect this invalid mapping, so no exception is thrown during compilation of the mappings, |
| Comment by Benjamin Eberlei [ 12/Jul/11 ] |
|
This kind of mapping error is already acknowledged by the schema-validator console task. |
| Comment by Alexandr Torchenko [ 13/Jul/11 ] |
|
Should I create second ticket? Please confirm that I understood correctly. Should we avoid such mapping as it is considered as invalid. |
| Comment by Benjamin Eberlei [ 13/Jul/11 ] |
|
Yes, it will not work at all. You dont need to create the second ticket as that error steams from the mapping error. You will see an error message when calling ./doctrine orm:schema:validate with this mapping. |
[DDC-1264] Add more math related DQL funcs (trig, round, stuff?) Created: 09/Jul/11 Updated: 09/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
[DDC-1262] Have proxies copy docblocks aswell Created: 09/Jul/11 Updated: 09/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0.6, 2.1, Git Master |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Whenever a Proxy is generated it does not copy the docblocks. This means when you do something like "$refl = new ReflectionObject($proxy)" you might be in trouble. However if we add docblocks then we have to make sure that proxies do not magically appear as entities by throwing an exception in the AnnotationDriver. |
[DDC-1263] @ManyToOne Arbitrary References Created: 09/Jul/11 Updated: 09/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Could it be possible to allow for arbitrary many to one entities through a "class + id" construct as join columns? |
[DDC-1259] Atomic creation of Proxy files Created: 08/Jul/11 Updated: 09/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
From 265e5086ea51ebcafc73f91abc64334d17e2f416 Mon Sep 17 00:00:00 2001 From: Karsten Dambekalns <karsten@typo3.org> Date: Wed, 25 May 2011 12:11:55 +0200 Subject: [PATCH 4/5] Use temporary file and rename for proxy class creation Instead of a simple file_put_contents() the proxy class code is written to a temporary file and renamed to the final filename. This allows file access even if only allowed by the directory permission. --- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index f0cf19c..b2d42fb 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -152,7 +152,15 @@ class ProxyFactory $file = str_replace($placeholders, $replacements, $file); - file_put_contents($fileName, $file, LOCK_EX); + $temporaryFileName = $fileName . uniqid( ) . '.temp'; + $result = file_put_contents( $temporaryFileName, $file ); + + if($result === FALSE) throw new \RuntimeException('The temporary proxy class file "' . $temporaryFileName . '" could not be written.'); + $i = 0; + while(!rename( $temporaryFileName, $fileName ) && $i < 5) { + $i++; + } + if($result === FALSE) throw new \RuntimeException('The proxy class file "' . $fileName . '" could not be written.'); } /** -- 1.7.4.1 |
| Comments |
| Comment by Benjamin Eberlei [ 09/Jul/11 ] |
|
Nette Framework uses a safe stream: https://github.com/nette/nette/blob/master/Nette/Utils/SafeStream.php |
[DDC-1235] Provide fluent interfaces in stub methods Created: 28/Jun/11 Updated: 29/Oct/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Andreas Hörnicke | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Or maybe some template-files could be provided for all stubs. private static $_setMethodTemplate = '/** * <description> * * @param <variableType>$<variableName> */ public function <methodName>(<methodTypeHint>$<variableName>) { <spaces>$this-><fieldName> = $<variableName>; <spaces>return $this;</spaces> }'; |
| Comments |
| Comment by Christophe Coevoet [ 29/Oct/12 ] |
|
@beberlei this should be closed as it is the case since 2.2 |
[DDC-1229] generate entity interactive dialog: id column Created: 27/Jun/11 Updated: 28/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Tools |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | David Buchmann | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
according to Stof, this bug https://github.com/sensio/SensioGeneratorBundle/issues/21 comes from the doctrine tools implementation: in the dialog, i first specified that i want a field id of type integer. the result was [Doctrine\ORM\Mapping\MappingException] Duplicate definition of column 'id' on entity 'Liip\DemoBundle\Entity\Event' in a field or discriminator column mapping. and no file was created. The dialog should tell me i can not create a field named id. (Or better ask first if i want my id column named id or something else.) It would be nice if it would write some file even if its not valid, with a warning on top. As it is, i lost all my work of specifying fields. (Luckily was just playing around) |
| Comments |
| Comment by Benjamin Eberlei [ 28/Jun/11 ] |
|
not a bug, its a feature (though a dumb one). Improvement in a next version. |
[DDC-1219] Remove dependancy on Collection interface in Domain Objects Created: 21/Jun/11 Updated: 04/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1 |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | André R. | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Short: This issue is all about being able to use doctrine with naked domain objects without any use of doctrine classes. Seems like some of the UnitOfWork code is cable of handling other types of arrays, like: // If $actualData[$name] is not a Collection then use an ArrayCollection.
if ( ! $actualData[$name] instanceof Collection) {
$actualData[$name] = new ArrayCollection($actualData[$name]);
}
But in __cascade* functions this is not the case in all but two: if ($relatedEntities instanceof Collection) {
if ($relatedEntities instanceof PersistentCollection) {
// Unwrap so that foreach() does not initialize
2 however have: if (($relatedEntities instanceof Collection || is_array($relatedEntities))) {
if ($relatedEntities instanceof PersistentCollection) {
// Unwrap so that foreach() does not initialize
Would it be an idea to do "instanceof Traversable" instead of " instanceof Collection"? |
| Comments |
| Comment by André R. [ 21/Jun/11 ] |
|
Note: If the fist code block is always performed before the last 2 blocks then there is no issue here, just a need to make it more clear in Doc that this is possible but that you should not rely custom implementation as PersistentCollection will be injected when loaded from db. |
[DDC-1217] Use the DBAL ReservedKeywordsValidator in orm:validate-schema Created: 20/Jun/11 Updated: 20/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Tools |
| Affects Version/s: | 2.0.6, Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Christophe Coevoet | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
DBAL provides a ReservedKeywordsValidator to check whether a word is reserved. But this tool is not used by the ORM when validating the schema. It would be useful to use it to avoid WTF from users getting a PDOException when creating their schema because of this. |
[DDC-1200] Derived Id Generator Created: 09/Jun/11 Updated: 09/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
For usage with the foreign key as primary key features described in |
| Comments |
| Comment by Daniel Lima [ 09/Nov/11 ] |
|
When this will be fixed? I think this is related to http://groups.google.com/group/doctrine-user/browse_thread/thread/7e1cfa9c4c99af31 |
[DDC-1201] DQL Example about count(*) related entity is wrong Created: 10/Jun/11 Updated: 10/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.1.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
DQL Example about count |
| Comments |
| Comment by Aigars Gedroics [ 10/Oct/11 ] |
|
Also similar DQL in documentation URL http://www.doctrine-project.org/docs/orm/2.1/en/reference/dql-doctrine-query-language.html#pure-and-mixed-results fails parsing stage: $dql = "SELECT u, 'some scalar string', count(u.groups) AS num FROM User u JOIN u.groups g GROUP BY u.id";
with error [Doctrine\ORM\Query\QueryException] [Semantical Error] line 0, col 40 near 'localizations)': Error: Invalid PathExpression. StateFieldPathExpression or SingleValuedAssociationField expected. Should be "count(g.id)" instead of "count(u.groups)". |
[DDC-1197] Proxies should handle variable argument lists Created: 05/Jun/11 Updated: 05/Jun/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This is a contingency issue for https://github.com/doctrine/doctrine2/pull/60 "Fix to allow for proxy generated classes to respect methods in parent which may use func_get_args internally. Previously they would be passed nothing and thus fail. Also reduces need to build up argumentString. " |
[DDC-1178] Have access to "original" metadata in events subscribed to loadClassMetadata Created: 27/May/11 Updated: 27/May/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.x |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Miha Vrhovnik | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
If you subscribe to loadClassMetadata you will usually modify the metadata for some classes. My proposal would be to add function get(Original|Raw)MappingData into interface Doctrine\ORM\Mapping\Driver\Driver which would either return raw data or data in a object specific for that Driver or null if it doesn't make sense for that driver. Please note, that when loading from e.g XmlDriver we should return simplexmlnode or dom node as loadClassMetadata should be in its own namespace and not pollute the Doctrine one. |
| Comments |
| Comment by Gediminas Morkevicius [ 27/May/11 ] |
|
Sounds logic, each driver would expect NULL or data (wrapped specifically for the driver used) |
[DDC-1164] doctrine:schema:update --force == doctrine:schema:create Created: 20/May/11 Updated: 20/May/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Geoff | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Doctrine:schema:update --force is the same as doctrine:schema:create. Under the hood, this may not be true, but they basically accomplish the same task. Schema:create should be removed, as it is redundant. Just look at django, one command to update db: ./manage.py syncdb Not saying that django gets everything correct, but the one command to synchronize the database is consistent. doctrine:schema:update should be smart enough to do all of the work, instead of relying on the redundant doctrine:schema:create. |
[DDC-1154] Proxies should take convention while loading *ToOne associations to reduce 1 extra query Created: 17/May/11 Updated: 17/May/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Guilherme Blanco | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Read the IRC log: [2:38pm] guilhermeblanco: beberlei: ping [2:38pm] guilhermeblanco: I'm curious about a feature if Doctrine supports [2:38pm] guilhermeblanco: if we do this on a proxy: [2:38pm] guilhermeblanco: $proxy->getOneToOneAssoc() [2:39pm] guilhermeblanco: shouldn't Doctrine already populate the assoc entity? [2:39pm] guilhermeblanco: it would be an inner join [2:39pm] beberlei: how would doctrine know it needs it? [2:39pm] guilhermeblanco: beberlei: it always repass the ClassMetadata to Persister [2:40pm] guilhermeblanco: so all needed item is to also pass the fieldname/assocname [2:40pm] beberlei: but how would doctrine know getOneToOneASsoc() really returns this assoc [2:40pm] beberlei: it could contain any logic [2:40pm] guilhermeblanco: it wouldn't... but as soon as we trigger __load($fieldName) [2:40pm] guilhermeblanco: we know that we could populate not only the Proxy, but also assoc [2:40pm] beberlei: by convention? [2:40pm] guilhermeblanco: ya [2:41pm] beberlei: sounds good, can you open a ticket? [2:41pm] guilhermeblanco: getUser() would trigger __load('user') [2:41pm] guilhermeblanco: sure! [2:41pm] guilhermeblanco: I'll pastie this as content... it would be awesome to have [2:41pm] guilhermeblanco: I see a lot of queries here that could be optimized |
[DDC-1143] deprecated or missing method, $cacheDriver->setManageCacheIds(true); Created: 10/May/11 Updated: 10/May/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | raiz | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
http://www.doctrine-project.org/docs/orm/2.0/en/reference/caching.html |
[DDC-1144] How insert a AES_ENCRYPT value in a table field Created: 10/May/11 Updated: 10/May/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | dquintard | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Win XP, MySql5, Php5.3, ZendFramework 1.11.4 |
||
| Description |
|
Hi there, Because '"INSERT statements are not allowed in DQL, ...." i processed like this:
How can i do ? /** Best regards David |
[DDC-1137] SchemaTool#getUpdateSchemaSql() does not respect database identifier in table names Created: 05/May/11 Updated: 14/May/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM, Tools |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Hugh Lomas | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux 2.6.18-194.32.1.el5.centos.plus x86_64 GNU/Linux |
||
| Description |
|
Given two databases, 'foo' and 'bar', with entities in /Entities/Foo/ annotated as follows: /** * Test * * @Table(name="foo.test") * @Entity */ Create an EntityManager instance with $connectionOptions = array(
'dbname' => 'Foo',
'driver' => 'pdo_mysql',
<..etc..>
);
Use EntityManager#getClassMetaData( "Entities\\Foo Use EntityManager#getClassMetaData( "Entities\\Foo Inserting die( print_r( $fromSchema, 1 ) . print_r( $toSchema, 1 ) . print_r( $schemaDiff, 1 ) ); into Doctrine/ORM/Tools/SchemaTool.php line 632 shows $fromSchema outputs [_tables:protected] => Array
(
[test]
but $toSchema outputs [_tables:protected] => Array
(
[foo.test]
which causes $schemaDiff to output [newTables] => Array
(
[foo.test]
In summary, Doctrine/DBAL/Schema/Comparator considers foo.test a new table, because Doctrine/DBAL/Schema/AbstractSchemaManager lists its table as "test" rather than "foo.test". |
| Comments |
| Comment by Hugh Lomas [ 05/May/11 ] |
|
It seems that changing AbstractSchemaManager.php to the following corrected the issue for me, however I am not sure of any repercussions that may arise as a result, being unfamiliar with the codebase. Doctrine/DBAL/Schema/AbstractSchemaManager.php line 228 return new Table( $tableName, $columns, $indexes, $foreignKeys, false, array()); Doctrine/DBAL/Schema/AbstractSchemaManager.php line 228 return new Table( $this->_conn->getDatabase() . "." . $tableName, $columns, $indexes, $foreignKeys, false, array()); |
| Comment by Benjamin Eberlei [ 14/May/11 ] |
|
Multi databases are not supported by schema manager and schema tool yet. |
[DDC-1106] Wrong inversedBy in example Created: 07/Apr/11 Updated: 07/Apr/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | cristobal castro | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
on page http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html |
[DDC-1038] there are tabs in the code base Created: 16/Feb/11 Updated: 16/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Task | Priority: | Major |
| Reporter: | Lukas Kahwe | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
a quick search through the ORM code base finds quite a few tabs. other doctrine projects there might also be some, though in common i only found some inside the LGPL license file. |
MsSQL-Server DateTime microseconds issue
(DDC-1028)
|
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Sub-task | Priority: | Major |
| Reporter: | Martin Weise | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
php5.3.5; MsSQL-Server 2005; W2K8; Apache2; MS pdo_sqlsrv_ts_vc6 driver |
||
| Description |
|
To ensure that the MsSQL-Server 2005 (and maybe higher) uses the format that is specified in the MsSqlPlatform class (Y-m-d) This should be done directly after the connection has be opened. |
| Comments |
| Comment by Martin Weise [ 14/Feb/11 ] |
|
Issue created as wished from Juozas Kaziukenas. |
[DDC-1025] Please repalce 'Doctrine\XXX\YYY' with '\Doctrine\XXX\YYY' in code and document Created: 09/Feb/11 Updated: 13/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation, DQL, Mapping Drivers, ORM, Tools |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | ben yan | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 7 |
| Labels: | None | ||
| Description |
|
It will help us use the namespace and code autocomplete in some IDE. |
| Comments |
| Comment by Matthieu Napoli [ 08/Apr/11 ] |
|
Hi, do you have any more information about this ? I'm confused because the php documentation uses the Doctrine\XXX way, and everywhere I've seen, it is used like that. Thanks |
| Comment by Karsten Dambekalns [ 11/Apr/11 ] |
|
The issue is simple and logical. When an IDE (I am using PhpStorm and it does it like this) sees a namespace in a file, upon seeing namespaces afterwards, it sees them as absolute if they have a leading backslash, or relative when it does not. This affects the resolution of classes for type navigation, code inspection, ... The same rules as for actual PHP code should be used within comments. Here is an example: namespace Foo;
class Bar {
/**
* @var Baz
*/
protected $baz;
/**
* @var \Quux
*/
protected $quux;
}
The IDE will think $baz is \Foo\Baz and $quux will be seen as being \Quux. Now if you have some reference to Doctrine here, and it was relative, the IDE would assume it's \Foo\Doctrine\... |
| Comment by Benjamin Eberlei [ 11/Apr/11 ] |
|
Well yes, but since all our code examples have no leading namespace argument this means the code is in the default namespace, making Doctrine\XXX\YY a relative namespace that is actually valid. |
| Comment by Karsten Dambekalns [ 11/Apr/11 ] |
|
Yes, but the source code docblocks are what is meant here as far as I am concerned. |
| Comment by Andrey Kolyshkin [ 13/May/11 ] |
|
Example (Entitymanager.php): namespace Doctrine\ORM; and /** * The used Configuration. * * @var Doctrine\ORM\Configuration */ private $config; Result: Should be: /** * The used Configuration. * * @var Configuration */ private $config; Or /** * The used Configuration. * * @var \Doctrine\ORM\Configuration */ private $config; |
| Comment by Miha Vrhovnik [ 27/May/11 ] |
|
Why don't you take this to the PhpStorm tracker as it surely is a bug in IDE? |
| Comment by Karsten Dambekalns [ 27/May/11 ] |
|
Miha, what makes you think it's an IDE bug? In a class in namespace Foo another class named Bar is \Foo\Bar, but \Bar is \Bar. Why is it a bug if the IDE follows the namespace resolution rules? |
| Comment by Michael Ridgway [ 11/Jul/11 ] |
|
The issue is that PHPStorm and NetBeans have different class resolution rules. I also use PHPStorm and most of Doctrine does not resolve auto-completion correctly because of this issue. I'd be willing to work on this if it would be accepted. |
| Comment by Andrew Mackrodt [ 29/Sep/11 ] |
|
I've been evaluating PhpStorm and also came across this issue; I believe the problem is due to Doctrine rather than being a bug with the IDE although it would be nice if PhpStorm would assume namespaces are absolute if they're not resolved upon an initial lookup. I created a quick c# app to append the beginning forward slash to any @var or @return attributes within Doctrine's source. It's working for me with Doctrine 2.1.2 and PhpStorm (IntelliJ): http://pastebin.com/4HxiWvJA - hopefully this will be of use for anyone else using these IDEs;. Note: the application doesn't detect multiple line annotations although the only one I'm aware of is the getAST method in Doctrine\ORM\Query.php. |
| Comment by Benjamin Eberlei [ 13/Dec/11 ] |
|
This issue is referenced in Github Pull-Request GH-215 |
| Comment by Benjamin Eberlei [ 13/Dec/11 ] |
|
This issue is referenced in Github Pull-Request GH-216 |
[DDC-1016] Example code does not reflect real code Created: 03/Feb/11 Updated: 03/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | thoth | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Website |
||
| Description |
|
http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-objects.html#entity-state In the switch cases all the UnitOfWork constants are invalid. Example: |
[DDC-1011] Finding out if a model is persist Created: 02/Feb/11 Updated: 02/Feb/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Ronny Deter | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
To find out if a model is persist, is missing in the documentation of doctrine 2. To become the state of an model you must call the entitymanager->getUnitOfWork()->getEntityState(model) |
[DDC-998] Code example for custom AST functions incorrect Created: 23/Jan/11 Updated: 23/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Timo A. Hummel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
On http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language the code example is slightly incorrect. Mistakes:
Additionally, the section should tell the user that he best has a look at lib/Doctrine/ORM/Query/AST/Functions/* to learn how to write custom functions. It also could be noted that stored procedures can be called with custom functions. |
[DDC-999] DQL always needs a FROM clause, should be changed Created: 23/Jan/11 Updated: 23/Jan/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Timo A. Hummel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
Sometimes a developer needs to issue a query without a FROM clause. This especially occurs using the QueryBuilder, when you may or may not have a table to select from, but call a stored procedure always. Example: $query = $em>createQuery('SELECT (1+1)');
The above query fails because the lexer expects T_FROM. If you replace (1+1) with a stored procedure, this example makes more sense. One might argue about that you should use DBAL directly, but I disagree, because it always can happen that you end up in a situation like this: $qb = $em->createQueryBuilder(); $qb->select("SOMEFANCYPROCEDURE()"); if ($condition) { $qb = $qb->from("additionalTable t"); } |
[DDC-993] Cookbook: Overriding the ID Generator during a database migration Created: 19/Jan/11 Updated: 28/Oct/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Timo A. Hummel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
If you need to override the ID Generator, e.g. during a migration, you can do that in your migration script as follows: Overriding the ID generator $em->getClassMetadata('foo\bar\Entity')->setIdGenerator(new \Doctrine\ORM\Id\AssignedGenerator()); Make sure that both calls equal to the same generator type. You can now modify the @Id fields in your entities. Additionally, make sure that you set the IdGenerator after you created the database using e.g. SchemaTool->create(). |
| Comments |
| Comment by Endre Kósa [ 27/Oct/12 ] |
|
Hi, this doesn't seem to work for me. I have written a small database export / import utility. As long as I use the automatic ID generation, everything works flawlessly, but I'm trying to preserve the existing IDs. I do exactly what you've suggested in your post. It works for @OneToOne relations, but I get the following error messages when persisting entities that are parts of @ManyToOne relations: |
| Comment by Endre Kósa [ 28/Oct/12 ] |
|
Never mind. I've upgraded to Doctrine 2.3.0 and it works as expected. |
[DDC-972] MySql MyISAM support Created: 07/Jan/11 Updated: 13/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | nicolas isnardi | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
We can not set MySql Engine for MyISAM. MySqlPlatform has a _getCreateTableSQL where you can pass some options with the engine param. |
| Comments |
| Comment by Cédric Tailly [ 19/May/11 ] |
|
I have the same problem and I didn't found documentation to select the engine for a given table. I tried to understand the code by myself and made modifications of my Doctrine v2.0.5, perhaps this is not the best one but here is a beginning of a solution : ------------------------------------------------------------------------------- @ ORM\Mapping\Driver\DoctrineAnnotations.php:100 final class Table extends Annotation { public $name; public $schema; public $indexes; public $uniqueConstraints; public $engine; }@ ORM\Mapping\Driver\AnnotationDriver.php:144 $primaryTable = array( @ ORM\Tools\SchemaTool.php:133 $table = $schema->createTable($class->getQuotedTableName($this->_platform)); if ( isset($class->table["engine"]) ) ------------------------------------------------------------------------------- ...and to define for instance the MyISAM engine in annotations : /**
Because there is no foreign key on MyISAM tables, there are still problems on the schema creation/update when Doctrine executes the corresponding "alter table" SQL commands. |
| Comment by gabriel sancho [ 12/Jul/12 ] |
|
in Doctrine 2.2.2 will be Doctrine/ORM/Tools/SchemaTool.php-149- /// PATCH ------------------------------------ Doctrine/ORM/Mapping/ClassMetadataInfo.php-1719- /// PATCH ------------------------------------ Doctrine/ORM/Mapping/ClassMetadataInfo.php-1723- /// PATCH ------------------------------------ Doctrine/ORM/Mapping/Table.php-42- /// PATCH ------------------------------------ Doctrine/ORM/Mapping/Driver/AnnotationDriver.php-181- /// PATCH ------------------------------------ i found a problem in ManyToMany relations, the intermediate table will be InnoDB |
| Comment by Benjamin Eberlei [ 13/Jul/12 ] |
|
You can do all tables as MyISAM already through metadata using @Table(options= {"engine": "MyISAM"}) except Many-To-Many Join Tables. But you could create a listener to the "postSchemaGenerate" event and accept the schema instance there, modify everything accordingly. |
| Comment by Christophe Coevoet [ 13/Jul/12 ] |
|
should we add the support of the options for the @JoinTable annotation ? |
| Comment by Benjamin Eberlei [ 13/Jul/12 ] |
|
Yes, that is probably what this ticket boils down to |
[DDC-952] Several features to batch eager selects more efficently Created: 27/Dec/10 Updated: 04/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Sub-Tasks: |
|
| Description |
|
This ticket aggregates several strategies to optimize batching of eager selects. |
| Comments |
| Comment by Benjamin Eberlei [ 31/Dec/10 ] |
|
Requirements for batching of eager loads: 1. Since we are using an IN() query for this we can only support this feature for entities that have a single column primary key. |
| Comment by Benjamin Eberlei [ 31/Dec/10 ] |
|
Next item to think about: What if an exception or event breaks the flow and "triggerEagerLoads()" is never called? |
[DDC-948] incorrect link from the types page to known vendor issues Created: 25/Dec/10 Updated: 25/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Lukas Kahwe | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
http://www.doctrine-project.org/docs/dbal/2.0/en/reference/types.html links to http://www.doctrine-project.org/docs/dbal/2.0/en/known-vendor-issues instead of http://www.doctrine-project.org/docs/dbal/2.0/en/reference/known-vendor-issues.html Also noticed that the documentation still says "Doctrine DBAL v2.0.0-BETA4 documentation" |
| Comments |
| Comment by Lukas Kahwe [ 25/Dec/10 ] |
|
err sorry .. this is of course a DBAL doc issue not and ORM issue. |
[DDC-923] Add note about DateTime Query Parameter Type Hint Created: 10/Dec/10 Updated: 10/Dec/10 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
[DDC-1484] GH-162: ProxyFactory creates proxy's parent structure if it doesn't exist Created: 08/Nov/11 Updated: 26/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/162 Wheeee, nested proxies can be generated without hassle! |
| Comments |
| Comment by Benjamin Eberlei [ 13/Nov/11 ] |
|
Marked as improvement |
| Comment by Benjamin Eberlei [ 16/Jun/12 ] |
|
A related Github Pull-Request [GH-162] was opened |
| Comment by Benjamin Eberlei [ 26/Jun/12 ] |
|
A related Github Pull-Request [GH-162] was closed |
[DDC-1475] Documentation for One-To-Many, Bidirectional Association does not have YAML example Created: 07/Nov/11 Updated: 07/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Christian Stoller | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When you are looking for a config example for the bidirectional mapping of an one-to-many association you will just find an example with XML, but not with YAML or PHP. It would be nice if somebody could add an example or a link to the bidirectional one-to-one association, because it should be the same, right? Here the link to the example: http://www.doctrine-project.org/docs/orm/2.0/en/reference/association-mapping.html#one-to-many-bidirectional |
[DDC-1465] Fetching partial objects doesn't work if HINT_FORCE_PARTIAL_LOAD is not explicitly used Created: 02/Nov/11 Updated: 11/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL |
| Affects Version/s: | 2.1.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Julien Pauli | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Using the DQL "partial" keyword is not enough to get a partial entity as a result. $q = $em->createQuery('SELECT partial r.{id,comment} FROM Entities\Rating r WHERE r.id=3');
$r = $q->getResult() /* HYDRATE_OBJECT is the default hydration mode */
Here, $r contains the full Entity, a SELECT * has been sent $q = $em->createQuery('SELECT partial r.{id,comment} FROM Entities\Rating r WHERE r.id=3');
$q->setHint(Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD, 1);
$r = $q->getResult() /* HYDRATE_OBJECT is the default hydration mode */
Here, $r contains only the selected fields, hence a true partial Entity |
[DDC-1459] Move DDC-331, DDC-448, DDC-493, DDC-513, DDC-698 Tests into SQLGeneration Testsuite Created: 29/Oct/11 Updated: 01/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
[DDC-1450] UnitOfWork Transaction Rollback Support Created: 24/Oct/11 Updated: 20/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The UnitOfWork does not handle the case very well where a rollback is necessary. Can this be optimized? |
| Comments |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
[DDC-1443] Subscribers reachs maximum nesting level when creating association on pre/postPersist with cascade persist Created: 20/Oct/11 Updated: 29/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Guilherme Blanco | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Suppose a situation where: A -> B Where the OneToOne unidirectional association contains cascade persist. If I decide to save an entity B that should create an A instance, it goes into maximum nesting level no matter if I track prePersist or postPersist. |
| Comments |
| Comment by Guilherme Blanco [ 20/Oct/11 ] |
|
Failing test case |
| Comment by Guilherme Blanco [ 20/Oct/11 ] |
|
Uploading a new version, now passing successfully, but consuming the onFlush event (which should not be ideal). |
| Comment by Benjamin Eberlei [ 29/Oct/11 ] |
|
Ah yes, this never worked. The transaction stuff will fix that. You have to use scheduleForInsert() something inside prePersist. |
[DDC-1445] Improve error messages Created: 22/Oct/11 Updated: 20/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Error messages throughout ClassMetadata validation and UnitOfWork cycles can be significantly improved. Work is being done on: https://github.com/doctrine/doctrine2/tree/ImproveErrorMessages |
| Comments |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
[DDC-1441] Metadata cannot be loaded for not registered proxy objects Created: 20/Oct/11 Updated: 05/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Aigars Gedroics | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
MySQL, Ubuntu, PHP 5.3.6 |
||
| Attachments: |
|
| Description |
|
We are using several Doctrine managers in our project with the same entity classes and different database tables. The problem appears when we are willing to merge entity with lazy associations from one manager to another. The second entity manager instance hasn't got the proxy object metadata defined yet so it fails with Doctrine\ORM\Mapping\MappingException exception "Class EntityProxy is not a valid entity or mapped super class.". If both entity managers share the proxy objects the problem can be fixed by calling $em->getProxyFactory()->getProxy('Entity', -1);
which will register the entity metadata for the proxy classname as well. Still if the proxy configuration differs, there is no fix found without changing the Doctrine ORM code. The fix inside the Doctrine would be to detect Proxy classes before loading the metadata and load the metadata for it's parent class instead. Please see the diff attached with proposed solution. Also I think this issue could arise when unserialized entity objects will be merged into the entity manager. I will try creating test case for this. |
| Comments |
| Comment by Aigars Gedroics [ 24/Nov/11 ] |
|
Test case attached. |
| Comment by Aigars Gedroics [ 05/Apr/12 ] |
|
See my pull request in https://github.com/doctrine/doctrine2/pull/332. |
[DDC-1438] Add test for DDC-1437 Created: 19/Oct/11 Updated: 19/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Add test for |
[DDC-1429] Add a method to the unit of work that merges any detached entity into UoW without calling SQL Created: 17/Oct/11 Updated: 17/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This is for those that know what they are doing |
[DDC-1415] EventListener delegate on entity basis Created: 11/Oct/11 Updated: 20/Dec/11 |
|
| Status: | Reopened |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Comments |
| Comment by Benjamin Eberlei [ 12/Dec/11 ] |
|
Removed from master, as i dont like the api at all |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
[DDC-1398] loading one item at a time when indexBy and EXTRA_LAZY fetch mode is used on a collection Created: 29/Sep/11 Updated: 10/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Reio Piller | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | None | ||
| Description |
|
collection->get($key) Atm in 2.1.2 this is loading the entire collection. It would be really handy that it would extra lazy load only one item using the association and indexBy fields and given key value (if collection is not initialized and the key havent been loaded yet ofc) Am i making sense with this? |
| Comments |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
| Comment by German Caseres [ 05/Mar/12 ] |
|
Is there any fix for this? i have the same problem. |
| Comment by Oleg Namaka [ 10/Mar/12 ] |
|
It makes a perfect sense here, I wish it was possible, it would give us a room for even more optimization. Any input on the issue from the developers? |
[DDC-1393] Skipping tables or columns in database driver or SchemaTool Created: 24/Sep/11 Updated: 20/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.1.1, Git Master |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
There should be a sane way to skip sources of errors in SchemaTool and the DatabaseDriver. |
| Comments |
| Comment by Benjamin Eberlei [ 24/Sep/11 ] |
|
Idea: Develop a datastructure of sorts that allows saving information about skipping tables and columns therein when reverse engeneering. |
| Comment by Guilherme Blanco [ 09/Dec/11 ] |
|
This is not possible unless you take advantage of Topological Sorting to map class dependencies like we do inside of UnitOfWork AFTER creating the ClassMetadata. The necessity of having this is mandatory because we can never skip classes that have associations to other ones though FK. |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
[DDC-1390] Lazy loading does not work for the relationships of an entity instance, whose class inherits from another entity class Created: 22/Sep/11 Updated: 06/Jan/13 |
|
| Status: | In Progress |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Alvarez Arribas | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian Linux 6.0, MySQL 5.0.51a |
||
| Attachments: |
|
| Description |
|
Lazy loading does not work for the relationships of an instance of an entity, whose class inherits from another entity class. Assume there are two entity classes, A and B, where A inherits from B. Now let $a be an instance of A, e. g. the result of "SELECT a FROM \A WHERE a.id = 1". Outputting $a will confirm it is a valid instance of a proxy object inheriting from A. Assume that the database row corresponding to $a contains a non-null foreign key that actually links to an existing row in another table, corresponding to another entity instance of a different class. Now, $a->someRelationship will always returns null in this scenario. I assume this is unintended behaviour, because clearly, the other entity should be lazily loaded on accessing it, and there is a value in the database. The fetch annotation attribute on that relationship has not been explicitly set, so I assume it is set to the default value, which, according to the docs, should be "lazy". The loading only fails when accessing the relationships of an entity instance, whose class inherits from another entity class. For entity instances, whose classes do not inherit from another entity class, lazy loading of their relationships works as expected. I had a look at the proxy objects and verified that they are present and override the __get method with an implementation containing a call to the load() method. Still, the loading won't work for some reason. This could be related to Bug |
| Comments |
| Comment by Benjamin Eberlei [ 31/Oct/11 ] |
|
Did this get fixed with the correction of your data? |
| Comment by Daniel Alvarez Arribas [ 01/Nov/11 ] |
|
No it did not. This issue is completely unrelated to the other one. For this, I have manually implemented workarounds, fetching the associations using DQL queries. Lazy loading in the inheritance scenario above still would not work. |
| Comment by Benjamin Eberlei [ 01/Nov/11 ] |
|
So A is an entity in a hierachy A -> B, and "someRelationship" is a field on A or on B Could you post parts of the mappings (entity docblock and the relationship)? |
| Comment by Daniel Alvarez Arribas [ 06/Nov/11 ] |
|
Hey, thanks for taking care of this. I attached the entities involved in the szenario to this issue. I had problems lazy loading entities through the following associations: Run.invoiceCreatorResult as well as InvoiceCreatorResult.dataVersion In this scenario, InvoiceCreatorResult, CommissionNoteCreatorResult and ConsumerInvoiceExporterResult all inherit from Result, which in turn inherits from a mapped superclass DataObject. Run and DataVersion inherit from DataObject directly. The associations where lazy loading does not work are associations both to and from the entity classes InvoiceCreatorResult, CommissionNoteCreatorResult and ConsumerInvoiceExporterResult. |
| Comment by Benjamin Eberlei [ 18/Nov/11 ] |
Just a short Q on understanding: Why is $a a proxy of A if you select it explicitly? |
| Comment by Benjamin Eberlei [ 18/Nov/11 ] |
|
This a working test-case with a model that i believe resembles yours exactly. I also put your models into another test and ran schema validation on them, which works out without problems. From the workflow with proxies, maybe |
| Comment by Daniel Alvarez Arribas [ 18/Nov/11 ] |
|
Regarding the proxy question, I just ment the query to be an example to further illustrate the type of $a. It was redundant and unnecessary though and probably misleading. Sorry for that. I did not select anything in the actual scenario. $a is merely some object of type A. No queries are involved. |
| Comment by Daniel Alvarez Arribas [ 18/Nov/11 ] |
|
Have you been able to make the tests fail with the original data provided? If not, I could set up a test case and post it. |
| Comment by Benjamin Eberlei [ 18/Nov/11 ] |
|
No i only checked the validity of mappings with the original data. If you could setup a testcase that would be really great. |
| Comment by Daniel Alvarez Arribas [ 19/Nov/11 ] |
|
I will set up a test case and upload it. I'll see if I can do it one of the next evenings. |
| Comment by Benjamin Eberlei [ 17/Dec/11 ] |
|
I tried again, also extended DDC-1390, but it was impossible for me to reproduce this. I ran this against master, 2.1.x and 2.1.1 specifically. |
| Comment by Daniel Alvarez Arribas [ 05/Jan/13 ] |
|
Sorry, I got swamped with work. Now I am working on this dedicatedly, testing against the latest release. Will let you know once I have a testcase. |
| Comment by Benjamin Eberlei [ 06/Jan/13 ] |
|
Good to hear, thanks for the persistent work on this. |
[DDC-1380] Standardize proxy class naming Created: 18/Sep/11 Updated: 18/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.x |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Johannes Schmitt | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
see https://github.com/doctrine/doctrine2/pull/125 |
[DDC-1371] Optimistic Locking using hash column or all columns Created: 10/Sep/11 Updated: 10/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
We can implement optimistic locking using hash values or other all columns of an entity |
[DDC-1357] Queries with multiple joins resulting in multiple scalar results for each top level entity only retain one scalar value for each entity Created: 01/Sep/11 Updated: 01/Sep/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Nils Adermann | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Consider this example: select g.id, u.id, u.status, count(p.phonenumber) numPhones from Group
* g join g.user u join u.phonenumbers p group by g.id, u.status, u.id
With data: phonenumbers:
[1, 2, 3, 4, 5, 6]
users:
[{id: 1, status: developer, phonenumbers: [1, 2]},
{id: 2, status: developer, phonenumbers: [3]},
{id: 3, status: developer, phonenumbers: [4, 5, 6]}]
groups:
[{id: 1, users: [1, 2]]},
{id:2, users: [3]}]
The result currently is: array(
array(
0 => object(CmsGroup) {
'id' => 1,
'users' => Collection(
object(CmsUser) { 'id' => 1 },
object(CmsUser) { 'id' => 2 }
)
},
'numPhones' => 1
),
array(
0 => object(CmsGroup) {
'id' => 2,
'users' => Collection(
object(CmsUser) { 'id' => 3 }
)
},
'numPhones' => 3
)
)
Note that the first entry contains only one value numPhones => 1, even though there are two users associated with that group. One of whom has 2 phone numbers and the other has 1. The result I would expect is: array(
array(
0 => object(CmsGroup) {
'id' => 1,
'users' => Collection(
object(CmsUser) { 'id' => 1 },
object(CmsUser) { 'id' => 2 }
)
},
'numPhones' => array(2, 1)
),
array(
0 => object(CmsGroup) {
'id' => 2,
'users' => Collection(
object(CmsUser) { 'id' => 3 }
)
},
'numPhones' => array(3)
)
)
The difference is that numPhones for each row now contains an array of the |
| Comments |
| Comment by Nils Adermann [ 01/Sep/11 ] |
|
You can find a test case for the correct result here: https://github.com/naderman/doctrine2/commit/a1ca3d9847cbc514fc951fb0b221b26fe03a6619 |
[DDC-1347] Github-PR-110 by shesek: Support NULL in EntityRepository's magic findBy and findOneBy methods Created: 25/Aug/11 Updated: 25/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of {username}: Url: https://github.com/doctrine/doctrine2/pull/110 Message: The magic `findBy` and `findOneBy` methods don't support passing NULL as the value, because ["we cannot (yet) transform it into IS NULL"](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L207). However, `BasicEntityPersister::_getSelectConditionSQL()` [does support that](https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php#L1229). It seems like leftovers from when there was no support for it. I tried it locally (after applying this change) and it does seem to work well. |
[DDC-1342] Github-PR-109: Remove trailing spaces Created: 21/Aug/11 Updated: 21/Aug/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
alOneh created a pull request on Github: Url: https://github.com/doctrine/doctrine2/pull/109 |
[DDC-1320] Ship Immutable date time with Doctrine Common, use in ORM - Should implement __toString() Created: 06/Aug/11 Updated: 31/Oct/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Comments |
| Comment by Benjamin Eberlei [ 31/Oct/11 ] |
|
Has to be pushed back as immutable date time cannot be implemented in userland that well. |
[DDC-1308] Add cache for transient information and invalidation for ClassMetadata Created: 31/Jul/11 Updated: 20/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Two different things have to be improved in the caching: 1. The information isTransient() has to be moved to the ClassMetadataFactory and cached there. |
| Comments |
| Comment by Guilherme Blanco [ 20/Dec/11 ] |
|
Updating fix version |
[DDC-2128] [GH-507] Now MetaDataFilter takess also regexp. For example whern you want to Created: 06/Nov/12 Updated: 06/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of catalinux: Url: https://github.com/doctrine/doctrine2/pull/507 Message: extract metadata if you would filter like this: --filter="Article" |
[DDC-2104] BasicEntityPersister::load() doesn't allow for cache usage Created: 25/Oct/12 Updated: 12/Nov/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Dan McFaul | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
This is a new feature, not a bug |
||
| Description |
|
BasicEntityPersister::load() calls: The executeQuery function has an optional fourth parameter to pass a QueryCacheProfile variable to use caching on the query. This is ignored/not implemented by BasicEntityPersister::load() |
[DDC-2102] Make optional SubselectFromClause Created: 25/Oct/12 Updated: 25/Oct/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Martin Hasoň | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Subselect ::= SimpleSelectClause [SubselectFromClause] [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] |
[DDC-2100] Getting Started: Code First PHP fatal error:Call to undefined method Bug::setDescription() Created: 24/Oct/12 Updated: 24/Oct/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Major |
| Reporter: | bronze1man | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
ubuntu 1204 php5.3.8 |
||
| Description |
|
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html ps: |
[DDC-2093] Doctrine Criteria does not support sorting by relationed field Created: 20/Oct/12 Updated: 06/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Bogdan Yurov | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
// Here I call Criteria filter
public function getWalletsActive() {
$criteria = Criteria::create()
->where(Criteria::expr()->eq("isRemoved", "0"))
->orderBy(array("currency.id" => "ASC"));
return $this->wallets->matching($criteria);
}
// Relation
/**
* @var Currency
*
* @ORM\ManyToOne(targetEntity="Currency")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="id_currency", referencedColumnName="id")
* })
*/
protected $currency;
// File BasicEntityPersister.php
// This cause the problem:
if ( ! isset($this->_class->fieldMappings[$fieldName])) {
throw ORMException::unrecognizedField($fieldName);
}
// There are no relations in $this->_class->fieldMappings at all!
|
| Comments |
| Comment by Benjamin Eberlei [ 06/Jan/13 ] |
|
Mark as improvement. |
[DDC-2089] Modify OneToMany to allow unidirectional associations without the need of a JoinTable Created: 19/Oct/12 Updated: 16/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.x |
| Fix Version/s: | 2.4, 3.0 |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Enea Bette | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | onetomany, persister, unidirectional | ||
| Environment: |
Debian Wheezy, Mysql 5.1, Apache2, PHP 5.4 |
||
| Description |
|
As I sayd in the title, it would be nice if the ORM layer could permit to map a 1:n association in the db as an unidirectional OneToMany in the classes, without using a JoinTable in the database. Is it possible? |
| Comments |
| Comment by Enea Bette [ 16/Dec/12 ] |
|
A little up... for inspiration from JPA |
[DDC-2087] Select colum Hydration Created: 18/Oct/12 Updated: 18/Oct/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Ivan Borzenkov | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Simple way to select colum SELECT u.id FROM User as u getResult give array( but how can take this array( |
| Comments |
| Comment by Ivan Borzenkov [ 18/Oct/12 ] |
|
for example http://stackoverflow.com/questions/11327798/change-the-getresult-array-key-for-the-primary-key-value this code would be good add in library |
[DDC-2048] [GH-457] Fixes case when an entity has a relationship with a class with joined inheritance Created: 29/Sep/12 Updated: 29/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of Fran6co: Url: https://github.com/doctrine/doctrine2/pull/457 Message: |
[DDC-2042] Metadata association overriding : allow to override 'targetEntity' Created: 26/Sep/12 Updated: 26/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Charles Rouillon | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
While associating object to an descriminated table I wasn't enable to fix the entityTarget (only one can be set in entity annotation). It could be resolve by adding the possibility to override 'targetEntity' value in Doctrine\ORM\Mapping\ClassMetadataInfo::ClassMetadataInfo(). Such as :
That would need to add a control on the new targetEntity in Doctrine\ORM\Mapping\ClassMetadataInfo::_validateAndCompleteAssociationMapping(). Such as :
cro. |
[DDC-2043] Extra cache operation in DBAL\Cache\ResultCacheStatement.php Created: 26/Sep/12 Updated: 26/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Bogdan Albei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS, PHP 5.3.10 |
||
| Description |
|
This is the closeCursor() method in DBAL\Cache\ResultCacheStatement.php: public function closeCursor() { $this->statement->closeCursor(); if ($this->emptied && $this->data !== null) { $data = $this->resultCache->fetch($this->cacheKey); if ( ! $data) { $data = array(); } $data[$this->realKey] = $this->data; $this->resultCache->save($this->cacheKey, $data, $this->lifetime); unset($this->data); } } We are using Memcache and I noticed an extra GET operation on all cache misses. In the code above I believe the fetch call is not necessary and that the code would do the same without it. |
| Comments |
| Comment by Christophe Coevoet [ 26/Sep/12 ] |
|
The SQL is used as a key because it is what identifies the query which is done (well, the statement and the parameters) |
| Comment by Bogdan Albei [ 26/Sep/12 ] |
|
The cacheKey already identifies the query(or at least it should). Would we have cases where different queries would want to use the same cache key? |
[DDC-2021] Array Data in Member OF Created: 09/Sep/12 Updated: 09/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | vahid sohrabloo | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | array, dql | ||
| Description |
|
Hi. |
[DDC-2007] [GH-434] allowed to pass filter objects to the configurator Created: 31/Aug/12 Updated: 05/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of bamarni: Url: https://github.com/doctrine/doctrine2/pull/434 Message: If |
[DDC-1999] Lazy loading doesn't get the field type when generating sql Created: 29/Aug/12 Updated: 29/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | victor Velkov | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When calling with lazy loading the Sql generated doesn't convert the parameters according to their types. After debugging the problem I found that the problem is in the getType($field, $value) function in the BasicEntityPersister as it is it will never be able to return the filed type when called for lazy loading for oneToMany or ManyToMany. I put a quick fix for my self private function getType($field, $value) { switch (true) { //here we have original code default: $type = null; // my fix starts here $fieldParts = explode('.', $field); if (count($fieldParts > 1)) { foreach ($this->_class->associationMappings as $mapping) { if (isset($mapping['joinColumnFieldNames'][$fieldParts[1]])) { $targetClass = $this->_em->getClassMetadata($mapping['targetEntity']); if (isset($targetClass->fieldNames[$fieldParts[1]])) { $type = $targetClass->fieldMappings[$targetClass->fieldNames[$fieldParts[1]]]['type']; } break; } } } //my fix end here } //here we have original code return $type; } i have only added that check in the default case of the switch. I am not sure if that is the most elegant way. I hope that helps and that it will be fixed soon. Thanks for the great work |
| Comments |
| Comment by Benjamin Eberlei [ 29/Aug/12 ] |
|
Fabio B. Silva Guilherme Blanco do we have a current best practice/policy regarding casting of join column types? There are some issues regarding it, this is another one. |
| Comment by Guilherme Blanco [ 29/Aug/12 ] |
|
We avoid the manual breakdown of path expressions. |
[DDC-2002] [GH-432] Add DBAL\TypeAwareObject type inference. Created: 29/Aug/12 Updated: 05/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of Romain-Geissler: Url: https://github.com/doctrine/doctrine2/pull/432 Message: DBAL allows you to define custom field types for your entities, and those are seamlessly converted from PHP to SQL value. However, you can't those custom types as parameters without type hinting it : ```php In my case, ``$customFieldValue`` is an object that won't work well if converted with the default string type. I added a new DBAL interface (see doctrine/dbal#193 ) and tweaked the parameter type inference so that custom values can advertise their DBAL type. There is currently no way to dynamically override the parameter type inference logic, this is one design that allows it in some cases. |
| Comments |
| Comment by Benjamin Eberlei [ 30/Aug/12 ] |
|
A related Github Pull-Request [GH-432] was closed |
[DDC-1996] [GH-429] Ensure a parameter mapping entry exists for InstanceOf DQL expressions Created: 22/Aug/12 Updated: 22/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of craigmarvelley: Url: https://github.com/doctrine/doctrine2/pull/429 Message: Hi, This is a possible fix for http://www.doctrine-project.org/jira/browse/DDC-1995, in that it resolves the issue for me but I'm afraid I haven't had time to test it extensively with more complex queries than the use case I gave in that ticket. Cheers, |
[DDC-1991] Add parameter indexBy to EntityRepository->createQueryBuilder() Created: 20/Aug/12 Updated: 20/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Philipp Cordes | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
createQueryBuilder() currently doesn’t have a parameter to set the third option on the FROM fragment: indexBy. Right now you have to read it, create a new From with the read properties and your desired indexBy value and replace the existing one on the QueryBuilder. Should be ten minutes’ work including tests. Thanks a lot! |
[DDC-1986] findBy hydration with limit and offset with Oracle database (oci8 driver) Created: 17/Aug/12 Updated: 08/Jan/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Grandfond | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | oracle | ||
| Environment: |
composer.json require : "php": ">=5.3.3", |
||
| Description |
|
I tried to use the findBy method with limit and offset parameters against an Oracle database using oci8 driver. The query seems to executed successfully but the hydrator fails when hydrating data as there is a DOCTRINE_ROWNUM column appending the "limit" clause. Here is the exception thrown : "Notice: Undefined index: DOCTRINE_ROWNUM in [...]/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php line 183" I was thinking about something like this to fix this issue
Maybe there is a better approach, what are your thoughts? |
| Comments |
| Comment by Benjamin Grandfond [ 17/Aug/12 ] |
|
I implemented it in my forks : https://github.com/benja-M-1/doctrine2/commit/c8d899b14446accf869ddc0043f4235284375755 It works for me, but I didn't write unit tests. |
| Comment by Benjamin Grandfond [ 24/Aug/12 ] |
|
Hi, Did you have time to have a look at this issue? Thanks |
| Comment by Christophe Coevoet [ 24/Aug/12 ] |
|
Please send a pull request when you submit a fix. It is the proper way to submit them for review. When we want to see things waiting for review, we look at the list of pending PRs, not at all comments of the issue tracker to find links in them. And I can tell you that this change has a big issue: it introduces a state in the database platform whereas it is currently stateless. This is likely to cause some issues when using more than 1 query (which is a common use case). |
| Comment by Benjamin Grandfond [ 29/Aug/12 ] |
|
Hi Christophe thank you for your feedback. I didn't send a PR because I wanted someone sharing his thoughts about what I suggested in this current issue. However I don't really understand the stateless argument, can you explain a bit more? Otherwise how would do you proceed to tell Doctrine not to hydrate platform-specific columns? |
| Comment by Christophe Coevoet [ 29/Aug/12 ] |
|
If you run several queries, they will be affected by the extra columns of previous requests, which is wrong |
| Comment by Benjamin Eberlei [ 29/Aug/12 ] |
|
I think the ObjectHydrator catches this by skipping undefined columns, i think we might just have overoptimized the SimpleObjectHydrator a little bit. |
[DDC-1971] [GH-419] Add ODM embedded-like functionality Created: 07/Aug/12 Updated: 14/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of djlambert: Url: https://github.com/doctrine/doctrine2/pull/419 Message: This PR adds ODM embedded-like functionality to the ORM. Including the new @MappedAssociation annotation on a field having a one-to-one association adds a discriminator column to the table for storing the class name of a "mapped" entity. This allows a class or mapped superclass with a one-to-one identifying association to be extended by additional entities without requiring any code changes (as is required with the discriminator map when using inheritance). I apologize if this is the incorrect way to submit a feature request. Currently just the annotation driver has been updated, I wanted to get feedback before continuing with the remaining drivers. Models and tests are included. |
[DDC-1965] Multiple Index fails if index name not specified Created: 02/Aug/12 Updated: 02/Aug/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Pont | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | Cli | ||
| Environment: |
Ubuntu 11.04, PHP 5.3.6 with Suhosin-patch, Symfony 2.0.15 |
||
| Description |
|
@ORM\Table(name="applications", indexes={@ORM\Index(name="csl_idx", columns= {"createdAt", "status", "loanType"}), @ORM\Index(name="s_idx", columns={"status"}), @ORM\Index(name="l_idx", columns={"loanType"})})the above Annotation creates 3 different indexes BUT when: * @ORM\Table(name="applications", indexes={@ORM\Index(columns={"createdAt", "status", "loanType"} ), @ORM\Index(columns= {"status"}), @ORM\Index(columns= {"loanType"})}) index-names not specified Symfony2 schemaUpdate tools shows only the last Index |
[DDC-1960] mapping joins in native queries breaks if select columns are starting with columns from joined table Created: 31/Jul/12 Updated: 21/Nov/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.4, 2.1.7 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Thomas Subera | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
ubuntu kernel 2.6.32-40-server |
||
| Attachments: |
|
| Description |
|
Using a simple Testcase like in http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/native-sql.html there are two Tables: *) users: Column | Type | Modifiers | Storage | Description ------------+---------+-----------+----------+------------- u_id | integer | not null | plain | u_name | text | not null | extended | address_id | integer | not null | plain | *) address: Column | Type | Modifiers | Storage | Description ----------+---------+-----------+----------+------------- a_id | integer | not null | plain | a_street | text | not null | extended | a_city | text | not null | extended | address_id is a foreign key to address; Now i created the Entities and setup a native query using ResultSetMappingBuilder: $rsm = new \Doctrine\ORM\Query\ResultSetMappingBuilder($entityManager); $rsm->addRootEntityFromClassMetadata('MyProject\Entity\Users', 'u'); $rsm->addJoinedEntityFromClassMetadata('MyProject\Entity\Address', 'a', 'u', 'address'); $query = ' SELECT u.*, a.* FROM users u LEFT JOIN address a ON (u.address_id = a.a_id) '; /** @var $native \Doctrine\ORM\NativeQuery */ $native = $entityManager->createNativeQuery($query, $rsm); $ret = $native->getResult(); This returns the Entities correctly:
array(2) {
[0] =>
class MyProject\Entity\Users#61 (3) {
protected $id =>
int(1)
protected $name =>
string(5) "Smith"
protected $address =>
class MyProject\Entity\Address#63 (4) {
protected $id =>
int(1)
protected $street =>
string(8) "Broadway"
protected $city =>
string(8) "New York"
protected $users =>
class Doctrine\ORM\PersistentCollection#64 (9) {
...
}
}
}
[1] =>
class MyProject\Entity\Users#66 (3) {
protected $id =>
int(2)
protected $name =>
string(7) "Sherlok"
protected $address =>
class MyProject\Entity\Address#67 (4) {
protected $id =>
int(2)
protected $street =>
string(13) "Oxford Street"
protected $city =>
string(6) "London"
protected $users =>
class Doctrine\ORM\PersistentCollection#68 (9) {
...
}
}
}
}
BUT if you change the order of the select columns starting with ones from address you get borked Data:
$query = '
SELECT
a.*,
u.*
FROM
users u
LEFT JOIN address a ON (u.address_id = a.a_id)
';
array(2) {
[0] =>
class MyProject\Entity\Users#61 (3) {
protected $id =>
int(1)
protected $name =>
string(5) "Smith"
protected $address =>
class MyProject\Entity\Address#63 (4) {
protected $id =>
int(2)
protected $street =>
string(13) "Oxford Street"
protected $city =>
string(6) "London"
protected $users =>
class Doctrine\ORM\PersistentCollection#64 (9) {
...
}
}
}
[1] =>
class MyProject\Entity\Users#66 (3) {
protected $id =>
int(2)
protected $name =>
string(7) "Sherlok"
protected $address =>
NULL
}
}
This happens because the function Doctrine\ORM\Internal\Hydration\AbstractHydrator::_gatherRowData does not consider the Mapping i set up. Instead it just add the columns as they get starting with address ones. Doctrine\ORM\Internal\Hydration\ObjectHydrator::_hydrateRow then knows the Mapping and ignores the first Address as there is no User to map on, cycling to the next row will then add the address of the second row to the user from the first one. There are multiple ways to fix this. One would be to consider the mapping in _gatherRowData, the second to rewrite the _hydrateRow generating the Entities first and then the mapping in a second foreach loop. This bugger had me for 2 days until i finally figured it out. thanks |
| Comments |
| Comment by Frederic [ 21/Nov/12 ] |
|
Hello, Has same issue with using DQL /createQuery() ! Try all the day to find where was my mistake but seems to be a CRITICAL bug ! Doctrine version used : 2.3.1-DEV <code> </code> Problem is that the order of the Aliases (cc, oc) is not considered on building SQL . $rowData = $this->gatherRowData($row, $cache, $id, $nonemptyComponents); returns Array [oc] => Array As "oc" is a mapping, on the first loop the $parentAlias is not yet known and so : else if (isset($this->_resultPointers[$parentAlias])) { echo $parentAlias." parentObject 2\n"; $parentObject = $this->_resultPointers[$parentAlias]; }else { // HERE : on first loop, for "oc", parent not yet known so skipped !!! continue; }</code> using a workaround on ObjectHydrator::hydrateRowData like this : make it work... Sorry for my dirty explanation... |
[DDC-1957] DB -> Entity: Reverse engeniering with two relations between two tables Created: 29/Jul/12 Updated: 29/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | sky diablo | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | Cli | ||
| Environment: |
windows 7, php 5.3, symfony 2.1 |
||
| Description |
|
i use the cli from the symfony 2.1 project to reverse from DB to Entity: php app/console doctrine:mapping:convert xml ./src/Acme/StoreBundle/Resources/config/doctrine/metadata/orm --from-database --force and i get tis error: [Doctrine\ORM\Mapping\MappingException] so i have a table "radUser" with two m:n relations to the same table "radAttributes": Table radUser: so doctrine reverse mapping try to generate the radAttribute entity with two mapping to radUser with the same field name "radUser", what can i do to prevent this issue ? |
[DDC-1954] Specialized Batch Insert Mode for the Entity Manager Created: 29/Jul/12 Updated: 29/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Johannes Schmitt | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
While it is already possible to speed up batch inserts by using raw SQL, that has the disadvantage to maintain a separate set of code that needs to be kept in sync with your schema. Therefore, it would be nice if the entity manager would provide a special batch insert mode where it can skip the change tracking related features, collection snapshots, etc. This might already be good enough for many people. |
[DDC-1645] Paths to Annotations classes are not considered Created: 10/Feb/12 Updated: 10/Feb/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation, Mapping Drivers |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | feathers and down | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
openSUSE 12.1 x86, Apache/2.2.21, mysql 5.5.16, PHP 5.3.8 (modules: Core, ctype, curl, date, dom, ereg, filter, gd, hash, http, iconv, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, pcre, PDO, pdo_mysql, pdo_sqlite, Reflection, session, SimpleXML, SPL, SQLite, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zip, zlib ) |
||
| Attachments: |
|
| Description |
|
Hi, my battle is described here: http://groups.google.com/group/doctrine-user/browse_thread/thread/db9c77b6bc000f13 When I follow bugtracker tutorial I think that there is an error when working with Annotations, see these examples: Start a new bugtracker project as described in tutorial from scratch, create folders and files as tutorial expose, then do following changes: 1) put Product, Bug, User class files at root level, same level as bootstraps files and create_xxxxx files 1) YAML so Setup method path argument is considered correctly, Doctrine engine must know where yaml files for classes are. 2) XML so Setup method path argument is considered correctly again, Doctrine engine must know where xml files for classes are. 3) Annotations so Setup method path argument IS NOT CONSIDERED, Doctrine engine use already defined classes to get Annotations docblocks using php reflexion classes, methods and functions. How to deal with this? I mean... a) Erase path argument from Setup::createAnnotationMetadataConfiguration methos (and similar functions for Annotations) because is not needed, classes and annotations must be defined before. I know that is easy to follow tutorial guidelines to develop applications in Annotations point of view, load them before Doctrine script start (with require/include or autoloaders, etc) and will work, but I think that is wrong how tutorial and functional logic are given, so a) and b) are my proposed solutions. I think b) should be right, get dockblocks from a class already defined and if are not defined it follow XML and YAML logic: read metadata from other files. Attachment: My bugtracker Netbeans project. Sorry by my english |
[DDC-1624] Locking CTI doesnt work on SQL Server Created: 29/Jan/12 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2 |
| Fix Version/s: | 2.4 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The WITH Keyowrd is appended to the whole FROM .. JOIN .. block instead of behind the FROM block. |
[DDC-1602] Executors for Class Table Inheritance (JOINED) are extremely slow on MySQL Created: 15/Jan/12 Updated: 27/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL |
| Affects Version/s: | 2.2-BETA2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Michael Moravec | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | None | ||
| Environment: |
Debian, MySQL 5.5.17 |
||
| Description |
|
Update and delete executors for Class Table Inheritance (JOINED) are extremely slow on MySQL platform. It is most probably due to use of subselect on the temporary table. /** * @Entity * @InheritanceType("JOINED") * @DiscriminatorColumn(name="discr", type="string") * @DiscriminatorMap({"root" = "Root", "a" = "SubA"}) */ class Root { /** * @Column(type="integer") * @Id * @GeneratedValue */ private $id; /** * @Column(type="integer") */ private $xyz; } /** * @Entity */ class SubA extends Root { /** * @Column(type="integer") */ private $foo; } Now lets perform a simple DQL UPDATE: UPDATE Entities\Root r SET r.xyz = 123 WHERE r.id > ? (note: always the upper half of entries) CREATE TEMPORARY TABLE Root_id_tmp (id INT NOT NULL) INSERT INTO Root_id_tmp (id) SELECT t0.id FROM Root t0 LEFT JOIN SubA s0_ ON t0.id = s0_.id WHERE t0.id > 25000 UPDATE Root SET xyz = 123 WHERE (id) IN (SELECT id FROM Root_id_tmp) DROP TEMPORARY TABLE Root_id_tmp The time spent on this on MySQL 5.5.17 and PostgreSQL 9.1 is:
As you can see, MySQL is drastically slower on even relatively small tables. This currently makes Doctrine unusable for this type of inheritance on MySQL. The solution probably would be to avoid subselect in WHERE clause in Doctrine\ORM\Query\Exec\MultiTableUpdateExecutor and Doctrine\ORM\Query\Exec\MultiTableDeleteExecutor. Feel free to try/modify the test script yourself, it's here. |
| Comments |
| Comment by Benjamin Eberlei [ 15/Jan/12 ] | ||||||||||||||||
|
Its not a bug as it works. The performance drawback of JTI is discussed in the manual http://www.doctrine-project.org/docs/orm/2.1/en/reference/inheritance-mapping.html. Changing this would be an improvement where we would hint if databases prefer subselects or joins for different operations. This would increase complexity of the SQL generation since now we are getting along with just one SQL generation strategy. | ||||||||||||||||
| Comment by Michael Moravec [ 11/May/12 ] | ||||||||||||||||
|
Any chance to get this implemented before 2.3? | ||||||||||||||||
| Comment by Michael Moravec [ 11/May/12 ] | ||||||||||||||||
|
I've made a change in DBAL and ORM code to implement a solution issue. It's currently more likely a proof of concept. With the change, my results are (approximately):
Currently only update executor was changed. Looking forward for your opinions. | ||||||||||||||||
| Comment by Michael Moravec [ 27/Jun/12 ] | ||||||||||||||||
|
bump |
[DDC-1599] OnFlush event in transaction Created: 14/Jan/12 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.4 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Gediminas Morkevicius | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 2 |
| Labels: | None | ||
| Description |
|
Is there any particular reason why onFlush event is not triggered when the transaction is allready open? https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L290 It would help a lot developing listeners since this event is the mostly used one and since theres preFlush now it seems a logical solution if onFlush would be a start of transaction in general |
| Comments |
| Comment by Benjamin Eberlei [ 14/Jan/12 ] |
|
onFluish is not the start of a transaction. It has nothing to do with this. |
| Comment by Marco Pivetta [ 31/Mar/12 ] |
|
Is a third event needed? Or is this to be marked as "won't fix"? |
| Comment by Benjamin Eberlei [ 31/Mar/12 ] |
|
Maybe onBeginTransaction, onCommit and onRollback. However since you can start transactions manually using $em->beginTransaction(), the Flush events are somehwat independent of transactions anyways. |
| Comment by Gediminas Morkevicius [ 31/Mar/12 ] |
|
Well, user can start transaction anytime, but the fact is that if we think ORM we do not know nothing about the database. we just persist and flush objects. Yes I think these would be very useful, from how I see it, if you use event listeners, is: loadClassMetadata: you can apply extra mapping onFlush: you can modify entity changesets, or persist recalculate new ones, without triggering the database, since it is not used to begin the database modifications yet. onBeginTransaction: could use the database modifications keeping in sync the entity changesets. the thing about this event is that usually in behavioral way atomic updates are required. for example nestedset tree sync lft rgt columns, sortable sync the sort index, materialized path, all these requires atomic updates, and the best place is the start of transaction. onCommit: could be useful to execute right before commit, finalizing database modifications could be done. onRollback: this one is really something, since if you go far, there might be something like files uploaded during the entity processing, and you may want to remove them if transaction fails. |
| Comment by Guilherme Blanco [ 21/May/12 ] |
|
This situation was barely documented here: http://www.doctrine-project.org/jira/browse/DDC-1443 We need a better Transaction API that completely fixes the computation of changesets and also allow more fine grained control over Entities and their corresponding information. I'd postpone this one until 3.0. |
[DDC-1590] Fix Inheritance in Code-Generation Created: 09/Jan/12 Updated: 10/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.4 |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Comments |
| Comment by Lukas Domnick [ 10/Dec/12 ] |
|
(I have no Link Privileges, but this one # |
[DDC-1570] GH-243: Add ProxyFactoryInterface to allow custom proxy factories Created: 28/Dec/11 Updated: 28/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/243 I'd love to have my custom proxy factory used with ORM, which is not possible at the moment (my experimental proxy https://github.com/juzna/doctrine2/commit/7822446036201b066e390b2e182cac1dc0c85430 and some comments about it http://blog.juzna.cz/2011/06/lazy-loading-in-php/) |
[DDC-1564] MySQL Failure when using setFirstResult() and omitting setMaxResults() Created: 25/Dec/11 Updated: 28/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.1.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Timo A. Hummel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When using setFirstResult() and omitting setMaxResults(), MySQL throws an error. This was very confusing for me until I dumped the SQL statements and found out the reason. I know that MySQL doesn't directly support this, their manual says that you should set the second parameter to LIMIT to a very high number (18446744073709551615 in their example). I'd recommend that either throwing an error in the specific platform driver or follow the MySQL example. |
| Comments |
| Comment by Benjamin Eberlei [ 28/Dec/11 ] |
|
Changed into improvement, i am not sure how this relates to other databases. You can just use this workaround yourself so long. |
[DDC-1549] GH-232: Recursive check for entity identifiers and hashes Created: 20/Dec/11 Updated: 22/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/232 Hi all! getType will check recursively to find a type for the identifier. trygetById improved, using a recursive function to find an id value instead of implode functions (that cause exceptions if the identifier is an object and do not implements __toString method). |
| Comments |
| Comment by Benjamin Eberlei [ 28/Dec/11 ] |
|
Mark as improvement |
| Comment by Benjamin Eberlei [ 22/Mar/12 ] |
|
A related Github Pull-Request [GH-232] was |
[DDC-1551] postFlush event listeners should be able to get a list of all flushed entities Created: 21/Dec/11 Updated: 23/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Albert Casademont | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 8 |
| Labels: | None | ||
| Description |
|
Testing the new Doctrine 2.2 Beta we finally got the postFlush event which is a nice way to handle things after all the DB work has finished. The main problem is that there is no way to get all the flushed entities. In the onFlush event you are able to use the getScheduledEntityUpdates/Inserts/Deletions but as these entities are flushed, those arrays are now empty. To solve this i see 2 aproaches: 1. Not unseting the array that holds the scheduled entities so the getScheduledEntityUpdates/Inserts/Deletions still have data. Those arrays are reset just before finishing the commit method so maybe unsetting them one by one as they are flushed is not necessary I can make a patch if necessary, just wanted to know if that sounds ok before starting it |
| Comments |
| Comment by Jasper N. Brouwer [ 23/May/12 ] |
|
I agree that Doctrine\ORM\Event\PreFlushEventArgs should contain a record of flushed entities, preferably reachable by entity-insertions/updates/deletions and collection-updates/deletions. I have a project (using Doctrine 2.1) which wrapped the flush call in my own. My flush dispatches custom preFlush/postFlush events (as they didn't exist in Doctrine 2.1), where my postFlushEventArgs does contain such a record. I've just upgraded my project to use Doctrine 2.2 and stumbled upon: Catchable fatal error: Argument 1 passed to Nw\Event\EntityEvent::postFlush() must be an instance of Nw\Event\Args\PostFlushEventArgs, instance of Doctrine\ORM\Event\PostFlushEventArgs given. It seems I've now hooked into Doctrine's postFlush (because I named the events the same way). I have renamed my events to work around this error, but I'd rather see my behavior implemented natively. PS: Using Doctrine 2.2.2 to be precise |
[DDC-1543] Support for Mapping Files on Traits Created: 17/Dec/11 Updated: 17/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
With PHP 5.4 and traits coming we should find a way where you can add xml and yml configurations for a trait and upon loading an entity X, it also loads the trait configuration of this entity. |
[DDC-1538] GH-217: [BUG] Schema Manager had no way to define extra options Created: 14/Dec/11 Updated: 17/Dec/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Pull-Request was automatically synchronized: https://github.com/doctrine/doctrine2/pull/217 Schema Manager had no way to define extra options ("comment" option for example). It is possible to add these options via Annotations. After the fix adding `@ORM\Column(type="string", options= {"comment" = "test"})` starts to work producing valid SQL schema with COMMENT output. |
[DDC-1513] Missing documentation for using references in Docs Created: 28/Nov/11 Updated: 29/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Thomas Gray | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I am in the process of switching over from Doctrine 2.0.7 to Doctrine 2.1 and one of the major missing components in my entities was the new use of using the mapping entity. Example:
<?php
namespace My\Project\Entities;
use Doctrine\ORM\Mapping\Entity as ORM;
/**
* @ORM\Entity(...)
*/
class Something
{
// Doctrine annotations here
}
The nessecity for this to be included in the entities is (as far as I can tell) nowhere to be found in the docs, so I am a little curious as to how people are supposed to know. I have also had a look here: http://www.doctrine-project.org/blog/doctrine-2-1-beta-release and can see no references too it. Am I missing something; or is it really just missing from the docs? |
| Comments |
| Comment by Erik Bernhardson [ 28/Nov/11 ] |
|
I also glanced through the docs and didn't find it. I would suggest it be added to the Annotations Reference page: http://www.doctrine-project.org/docs/orm/2.1/en/reference/annotations-reference.html |
| Comment by Thomas Gray [ 29/Nov/11 ] |
|
Ahh, so there are some docs about it; http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html however they do not seem to be that clear; nor well linked too. |
[DDC-1507] State change detection for version incrementation (for optimistic locking) in combination with orphanRemoval Created: 23/Nov/11 Updated: 27/Nov/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.4 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Georg Wächter | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
As i understand the documentation correctly, orphanRemoval associations have the meaning of a "part of" relationship. In the example (http://www.doctrine-project.org/docs/orm/2.0/en/reference/working-with-associations.html#orphan-removal) the adresses are part of the contact. In my opinion we should reason that the state of the adress consists of the states of all nested contacts. As a consequence we should flag the contact as "dirty" when the adresses change. This is relevant for optimistic locking scenarios or event handlers. In my application i tried to use optimistic locking for "contacts", which does not work if i don't change anything in the contact but only in the nested addresses. |
| Comments |
| Comment by Benjamin Eberlei [ 27/Nov/11 ] |
|
This is still only an approvement, you can workaround this and handle is in your domain code. |
| Comment by Georg Wächter [ 27/Nov/11 ] |
|
Not in all cases. The first problem is that my domain code can't modify the version property, doctrine seems to block any manipulations to it. So i'm not able to increment the variable myself. The only solution is to implement optimistic locking on my own or to add a dummy persistent boolean field that gets inversed by my domain code .. which would trigger the doctrine implementation for the optimistic locking. I think it's clear that the second option shouldn't be a choice. If doctrine doesn't handle the overall case exactly it should allow me to increment the version number myself. |
Possible Regression with OneToOne relation
(DDC-1461)
|
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Sub-task | Priority: | Major |
| Reporter: | Maxim | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
/**
* @ORM\Entity
*/
class Top
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToOne(targetEntity="LevelOne", orphanRemoval="true", cascade={"persist", "remove"})
*/
protected $levelOne;
public function getId()
{
return $this->id;
}
public function setLevelOne(LevelOne $levelOne)
{
$this->levelOne = $levelOne;
}
public function getLevelOne()
{
return $this->levelOne;
}
}
/**
* @ORM\Entity
*/
class LevelOne
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\OneToOne(targetEntity="LevelTwo", orphanRemoval="true", cascade={"persist", "remove"})
*/
protected $levelTwo;
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
}
public function setLevelTwo(LevelTwo $levelTwo)
{
$this->levelTwo = $levelTwo;
}
public function getLevelTwo()
{
return $this->levelTwo;
}
}
/**
* @ORM\Entity
*/
class LevelTwo
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function getId()
{
return $this->id;
}
public function setId($id)
{
$this->id = $id;
}
}
trying to clone objects $top = new Top(); $top->setLevelOne(new LevelOne()); $top->getLevelOne()->setLevelTwo(new LevelTwo()); $this->em->persist($top); $this->em->flush(); $newTop = new Top(); $newTop->setLevelOne(clone $top->getLevelOne()); $newTop->getLevelOne()->setId(null); $newTop->getLevelOne()->getLevelTwo()->setId(null); var_dump($newTop->getLevelOne()->getId()); var_dump($newTop->getLevelOne()->getLevelTwo()->getId()); $this->em->persist($newTop); $this->em->flush(); the output is: |
[DDC-1938] [GH-406] [WIP] - DCOM-96 - Moving proxy generation and autoloading to common Created: 21/Jul/12 Updated: 26/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of Ocramius: Url: https://github.com/doctrine/doctrine2/pull/406 Message: This PR is related to doctrine/common#168. In this PR, the `ProxyFactory` has been reduced to an object builder and it's public API has been kept intact (While the proxy `Autoloader` has been moved to doctrine/common). It would be interesting to define what this builder could do with the `ProxyFactory` to get its own customizations introduced. |
| Comments |
| Comment by Benjamin Eberlei [ 25/Jan/13 ] |
|
A related Github Pull-Request [GH-247] was opened |
| Comment by Benjamin Eberlei [ 26/Jan/13 ] |
|
A related Github Pull-Request [GH-247] was closed |
[DDC-1924] Let SQLFilters know the query type it is being applied to Created: 13/Jul/12 Updated: 13/Jul/12 |
|
| Status: | Reopened |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Jan Knudsen | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I'm making an access control system and would like to automatically filter all queries based current user, targetEntity type and query type. Query type is relevant as different permissions are needed by the user for SELECT, UPDATE, DELETE and INSERT queries. I can access the first two things in my filter easily enough, but I cannot find a way to have the filter know what type of query the filter is being applied to. |
| Comments |
| Comment by Benjamin Eberlei [ 13/Jul/12 ] |
|
The Filter API only makes sense for SELECT clauses. Doctrine itself does not use DQL to do updates internally, so you need to use other mechanisms (EventListener) to prevent this operations if they are not allowed for a user. |
| Comment by Jan Knudsen [ 13/Jul/12 ] |
|
But I can make custom DQL to update rows and would like to automatically filter this too. e.g. $em->createQuery("UPDATE SomeEntity se SET se.field = "updated!")->execute(); The lifecycle events preUpdate etc. are not called when doing custom DQL queries. Maybe it is bad practice and discouraged to do updates, inserts and deletes as custom DQL queries, but I would like to ensure that the other people in my organization can't accidentally bypass the Access Control, even if they make use of such bad practice. And if the filter API only makes sense for Select statements, why are filters applied to update/delete/etc. statements too? |
| Comment by Benjamin Eberlei [ 13/Jul/12 ] |
|
Well, they are applied to DQL UPDATE/DELETE. But not not UPDATE/DELETE that works through the internals of Doctrine. So yes, you can use it to filter DQL DELETE/UPDATE, but doctrine does not do that internally. So you have to have two strategies, a DQL/SQL Filter - and Lifecycle events. |
| Comment by Jan Knudsen [ 13/Jul/12 ] |
|
Which is fine by me. I already implemented the checks using lifecycle events before opening this issue. The access control is automatically handled when using the entitymanager and not custom DQL. Now I would also like to filter the custom DQL, but currently I can't, because as originally stated, the filter needs to know which type of query it is being applied to. |
[DDC-1923] Type conversion error with oracle Created: 12/Jul/12 Updated: 12/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
https://github.com/symfony/symfony/pull/4730 |
[DDC-1913] Updates for Fedora packaging Created: 07/Jul/12 Updated: 07/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Shawn Iwinski | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fedora |
||
| Description |
|
I am packaging the DoctrineDBAL PEAR package for Fedora and would like to have the following updates:
|
[DDC-1899] [GH-385] set metadata for interface to be able to fetch entites by interface name Created: 29/Jun/12 Updated: 07/Jul/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of Burgov: Url: https://github.com/doctrine/doctrine2/pull/385 Message: using the new ResolveTargetEntity functionality we noticed we needed another feature: From the Symfony Bundle defining the interface, we'd like to be able to fetch entities by this very interface name, e.g.: ``` php or ``` php This PR sets metadata for the interface when metadata for a class is loaded that the interface is configured for |
[DDC-1894] Cannot view Doctrine 2.2 QueryBuilder documentation Created: 27/Jun/12 Updated: 27/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Type: | Documentation | Priority: | Major |
| Reporter: | Douglas Teoh | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Chrome, Firefox, Safari on OS X |
||
| Description |
|
Visiting the following page: http://www.doctrine-project.org/api/orm/2.2/class-Doctrine.ORM.QueryBuilder.html always redirects back to http://www.doctrine-project.org/api/orm/2.2/ |
[DDC-1882] AbstractQuery#getResultCacheId() should be public to be able to manage the cache Created: 19/Jun/12 Updated: 19/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.6 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Ignacio Larranaga | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
The method getResultCacheId of Doctrine\ORM\AbstractQuery should be public. I'm trying to customize the cache refresh mechanism to clear previously cached objects in my app. |
| Comments |
| Comment by Ignacio Larranaga [ 19/Jun/12 ] |
|
Attaching the patch despite is a trivial change. |
[DDC-1879] Orphans are neither nulled nor removed when merging a graph of detached entities Created: 18/Jun/12 Updated: 23/Jan/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Philippe Van Eerdenbrugghe | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Doctrine 2.2.2 |
||
| Description |
|
When merging a graph of detached entities, the created entitied are created and the updated entities are updated but the non-present entities (which exist in the database but are not in the graph) are neither removed nor have them their association column nullified. Example : In my code I have 2 entities : Parent and Child. There is a OneToMany(cascade= {"all"}, orphanRemoval=true) relation defined in Parent. In my database I have a Parent row with an id of 1, which has 3 Children with ids 1,2,3. When I write the following code, I expect the Parent with id 1 and the Child with id 2 to be updated, a new Child to be created and the Child with id 1 and 3 to be deleted. $parent = new Parent(); $parent->id = 1 // detached entity $existing_child = new Child(); $child->id = 2 // detached entity $new_child = new Child(); // new entity $dinner->addChild($existing_child); $dinner->addChild($new_child); $em->merge($dinner); $em->flush(); The objects I expect to be created and updated have the correct behaviour but the old children are not touched, they are still present in the database. |
| Comments |
| Comment by Marco Pivetta [ 23/Jan/13 ] |
|
I don't think this is valid. Orphan removal scheduling is handled only when an unit of work is available. What's the state of `$dinner` before your example? Can you `var_dump` it? |
[DDC-1860] Make usage of Composer for CLI optional Created: 09/Jun/12 Updated: 09/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Marco Pivetta | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
There's two problems with current CLI implementation: 1 - composer `autoload.php` file is hardcoded, which means that it is making assumptions about where `doctrine/orm` has been installed, and it also makes the assumption that `doctrine/orm` is not the main package. |
| Comments |
| Comment by Marco Pivetta [ 09/Jun/12 ] |
[DDC-1859] Implement console command to convert DQL into object running NativeQuery Created: 08/Jun/12 Updated: 08/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Guilherme Blanco | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
As per our conversation during SFLive Paris 2012, we should create a command that receives a DQL and exposes back to you a PHP code of an object holding a conversion to NativeQuery, which is faster. |
[DDC-1852] Doctrine\ORM\Tools\SchemaValidator should check validity of lifecycle callbacks Created: 04/Jun/12 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.4, 2.x, Git Master |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Marco Pivetta | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The schema validator should analyze mapped lifecycle callbacks and: a) if some lifecycle callbacks were defined, but no @HasLifecycleCallbacks annotation/mapping was set, warn the user |
| Comments |
| Comment by Marco Pivetta [ 04/Jun/12 ] |
|
Existing PR at https://github.com/doctrine/doctrine2/pull/361 |
[DDC-1840] Create ParameterCollection indexed and implement it on AbstractQuery and QueryBuilder Created: 26/May/12 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.4 |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Guilherme Blanco | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Currently, method setParameters in AbstractQuery and QueryBuilder only appends new parameters to the list. It should actually override the existing ones. |
| Comments |
| Comment by Benjamin Eberlei [ 27/May/12 ] |
|
Not a bug |
[DDC-1829] [GH-352] Add the posibility to add a custom Comparator for Schema tool Created: 21/May/12 Updated: 22/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of catacgc: Url: https://github.com/doctrine/doctrine2/pull/352 Message: See catacgc/dbal#153 |
[DDC-1820] [GH-348] [DDC-1819][WIP] Arbitrary object hydrator Created: 14/May/12 Updated: 27/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of marijn: Url: https://github.com/doctrine/doctrine2/pull/348 Message: Initial work (in progress) on a test suite for the arbitrary object hydrator, as discussed in DDC-1819[1]. Any tips are appreciated. I'm not too sure what the test suite should and should not cover. Other questions I have include: 1. Should the `HYDRATE_ARBITRARY_OBJECT` constant be added to the `AbstractQuery` class or the `NativeQuery` class? It only makes sense in the former but it might be missed when more constants are added in the future... [1]: http://www.doctrine-project.org/jira/browse/DDC-1819 |
[DDC-1813] Save column types in ClassMetadataInfo#columnTypes array instead of ClassMetadataInfo#fieldMappings['type'] Created: 06/May/12 Updated: 06/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | ross neacoders | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Because you save column types in fieldmappings only, type information is not saved for join columns. Not having type info for join columns, makes it impossible to do call 'convertToPhpValue' on join columns. For example see a demo of problem here: |
[DDC-1817] Allowing to specify MySQL Collation on Field Basis Created: 08/May/12 Updated: 08/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers, Tools |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Johannes Schmitt | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
It would be nice to be able to specify which collation to use on a field basis. This would for example be useful when you have case-sensitive (utf8_bin), and case-insensitive (utf8_general_ci) values. Right now, this needs to be manually added to migration files (which is ok for projects, but it is not so nice for distributable libraries). |
[DDC-1814] Save quoted info in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings['fieldname']['quoted'] Created: 06/May/12 Updated: 06/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | ross neacoders | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Similar to DDC-1813 I propose saving 'quote' status in ClassmetadataInfo#quotedColumns instead of ClassmetadataInfo#fieldmappings['fieldname']['quoted'] Otherwise you have quotation info only for fieldColumns and not association columns |
[DDC-1806] DQL with and without fetch join cause Created: 01/May/12 Updated: 01/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL, ORM |
| Affects Version/s: | 2.2, 2.2.1, 2.2.2, Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Marco Pivetta | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
When running following DQL in newly cleared EntityManager, with the provided entities (see attached archive or gist at https://gist.github.com/2473775 ), results in different fetched association: DQL without join: SQL without join: Result without join: DQL with fetch join: SQL with fetch join: Result with fetch join: The problem seems to be strictly related with how the `@JoinColumn` is configured. |
| Comments |
| Comment by Marco Pivetta [ 01/May/12 ] |
|
Attaching failing test from https://github.com/Ocramius/doctrine2/compare/DDC-1806 |
[DDC-1812] Modify ResultSetMapping#addMetaResult function definition Created: 06/May/12 Updated: 06/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.2, 2.2.1, 2.2.2, Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | ross neacoders | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Give correct names to arguments public function addMetaResult($alias, $columnName, $fieldName, $isIdentifierColumn = false) { $alias - should be $tableAlias Here are some exmple calls from code: |
[DDC-1803] Paginator usage with a DQL query that is using 2 time the same named binded value failed Created: 30/Apr/12 Updated: 25/Jan/13 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Marc Drolet | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
linux, oracle |
||
| Description |
|
I use a dql query where I bind a named parameter 2 time in the same query for different joined fields. The query work but the count query failed saying that there are missing bind variable. ex: , partial ca.{id} , ') $onTheMarket = new Paginator($qb, $fetchJoin = true); To make it work, I've renamed the second usage of the named variable with a 2 at the end. deleted2 and published2. |
| Comments |
| Comment by Marco Pivetta [ 23/Jan/13 ] |
|
This seems to be quite old. Marc Drolet is it still valid with the latest ORM? |
| Comment by Marc Drolet [ 25/Jan/13 ] |
|
I'll try to test this problem on an updated version and I'll let you know. |
| Comment by Marco Pivetta [ 25/Jan/13 ] |
|
Ok, marking as awaiting feedback |
[DDC-1792] [GH-340] add public has() method to filter collection. Created: 19/Apr/12 Updated: 04/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of pjedrzejewski: Url: https://github.com/doctrine/doctrine2/pull/340 Message: Sorry if there is any reason why this is not implemented already. |
[DDC-1787] Fix for JoinedSubclassPersister, multiple inserts with versioning throws an optimistic locking exception Created: 18/Apr/12 Updated: 18/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Jack van Galen | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Attached is a small patch for a bug in the file JoinedSubclassPersister.php. When persisting multiple new entities that are subclasses of a baseclass (joined), and having the @Version attribute set, only for the last one a query is run to fetch the new value of the version field. The other one is tested with NULL, and throws an optimistic locking exception. |
[DDC-1785] Paginator problem with SQL Server around DISTINCT keyword. Created: 18/Apr/12 Updated: 19/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
PDOException: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL Server]Incorrect syntax near the keyword 'DISTINCT'. (uncaught exception) |
| Comments |
| Comment by Craig Mason [ 18/Oct/12 ] |
|
There are four major issues with this: 1: SQLServerPlatform.php modifies the query to prepend 'SELECT ROW_NUMBER() OVER ($over)', which is inserted before the DISTINCT keyword. 2: The order needs to be placed inside the OVER($over) block. At this point, the regex is using the exact column name rather than the alias, so the outer query cannot ORDER. 3: The DISTINCT queries select only the ID columns - as OVER() required the sort column to be available in the outer query, IDs alone will not work. 4: SQL Server cannot DISTINCT on TEXT columns. 2005,2008 and 2012 recommend using VARCHAR(MAX) instead, which does support it. That doesn't help us with 2003. We work around that with a custom TEXT type that casts as varchar. Incidentally, 2012 supports LIMIT, which gets rid of this issue altogether. Edit: Added #3 |
| Comment by Craig Mason [ 18/Oct/12 ] |
|
I have a (very hacky) implementation working that uses regexes to correct the query so that it will execute. This also required modification in the ORM paginator, to select all columns instead of just IDs. https://github.com/CraigMason/dbal/commit/4ecd018c73e387904f78d81f1d327e34e905c5f1 This is certainly not a patch - more guidance. One interesting point... I had to wrap the whole query in a second SELECT *, as the WHERE IN confusingly returns non-distinct rows when part of the first inner query. No idea why this happens, but moving it out one layer makes it operate correctly. |
| Comment by Craig Mason [ 25/Oct/12 ] |
|
Updated, view all commits for this experimental branch here: |
| Comment by Craig Mason [ 29/Oct/12 ] |
|
This got waaaay too messy with regex alone due to the complicated nesting. As such, I have written the basis of a new SqlWalker class which can be used to create DISTINCT queries based on the root identifiers. It's not proper DISTINCT support, but it's a step forward. https://github.com/CraigMason/DoctrineSqlServerExtensions I've also added a Paginator (which was the original issue I had!) The current SqlWalker always sticks the ORDER BY on the end of the query, which just doesn't work properly with SqlServer. Is a vendor-specific walker breaking the DQL abstraction? Should this type of code be on the Platform object in the DBAL? Anyway, this repo fixes our immediate problem, and it would be good to revisit this in a wider context. Hopefully we can get some good SQL server support - there are plenty of other issues to deal with (UTF-8/UCS2, nvarchar etc) |
| Comment by Benjamin Eberlei [ 19/Jan/13 ] |
|
Craig Mason We don't have an SQL Server expert on the team, so if you want really good support you should join and help us with it. |
[DDC-1760] [GH-324] simplified __call method Created: 03/Apr/12 Updated: 07/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of brikou: Url: https://github.com/doctrine/doctrine2/pull/324 Message: |
| Comments |
| Comment by Benjamin Eberlei [ 04/Apr/12 ] |
|
A related Github Pull-Request [GH-324] was synchronize |
| Comment by Benjamin Eberlei [ 06/Apr/12 ] |
|
A related Github Pull-Request [GH-324] was synchronize |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-324] was synchronize |
[DDC-1756] Allow for master table only models on joined subclass inheritance Created: 03/Apr/12 Updated: 03/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Markus Wößner | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Think of a joined subclass inheritance setup where abstract base class A has many concrete child classes C1 ... CN. For each child class a table necessarily has to created. Yet if there are many child classes not defining any additional fields you will get many "id only" child tables. This leads to unnecessary join and insert overhead on database operations as well as a bunch of quite senseless tables in your schema that need to be maintained. While there are already tickets requesting support for mixed inheritance mapping (e.g. DDC-138) I want to propose another - obviously easy to implement - solution that addresses the "id only table" problem. The basic idea is to extend ClassMetadata by a flag "hasOwnTable" which is true by default and applicable for child classes of a joined subclass tree. Setting this flag to <false> would lead to... (3) can easily be implemented since the mentioned methods all loop on ClassMetadata::parentClasses. For those classes which set the flag "hasOwnTable" to false the operation will be skipped. On the other hand (2) doesn't seem to a big deal either. Extending SqlWalker::_generateClassTableInheritanceJoins() by means of a flag test seems to be enough. Of course setting the flag to <false> while defining additional fields on child class level must be rejected. If you go for this feature I would be pleased to provide an implementation. |
[DDC-1750] [GH-319] [WIP] Added support to Multiple ID Generators Created: 01/Apr/12 Updated: 27/May/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of guilhermeblanco: Url: https://github.com/doctrine/doctrine2/pull/319 Message: |
| Comments |
| Comment by Benjamin Eberlei [ 01/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 01/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 02/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 02/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 03/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 03/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 04/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 06/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-319] was synchronize |
[DDC-2305] [GH-584] QueryBuilder::addCriteria improvements Created: 19/Feb/13 Updated: 19/Feb/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of chEbba: Url: https://github.com/doctrine/doctrine2/pull/584 Message: 1. Fix problem with different comparisons on the same field in QueryExpressonVisitor (now index value is added). |
| Comments |
| Comment by Benjamin Eberlei [ 19/Feb/13 ] |
|
A related Github Pull-Request [GH-584] was opened |
[DDC-2290] Infer custom Types from the field for query parameters Created: 08/Feb/13 Updated: 08/Feb/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Matthieu Napoli | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |
|
When using a mapping Type that declares convertToDatabaseValue, the method is not always called in queries. Example: SELECT ... WHERE entity.field = ?1 (with entity.field being of custom type 'the_mapping_type') Type::convertToDatabaseValue() is correctly called when using:
$query->setParameter('1', 'foo', 'the_mapping_type');
But it is not called when using:
$query->setParameter('1', 'foo');
which gives a query that returns invalid results. Like other mapping types in this situation, there is no reason the type is not inferred automatically from the field. I have written a failing test case in Doctrine\Tests\ORM\Functional\TypeValueSqlTest:
public function testQueryParameterWithoutType()
{
$entity = new CustomTypeUpperCase();
$entity->lowerCaseString = 'foo';
$this->_em->persist($entity);
$this->_em->flush();
$id = $entity->id;
$this->_em->clear();
$query = $this->_em->createQuery('SELECT c.id from Doctrine\Tests\Models\CustomType\CustomTypeUpperCase c where c.lowerCaseString = ?1');
$query->setParameter('1', 'foo');
$result = $query->getResult();
$this->assertCount(1, $result);
$this->assertEquals($id, $result[0]['id']);
}
|
| Comments |
| Comment by Matthieu Napoli [ 08/Feb/13 ] |
|
See also http://www.doctrine-project.org/jira/browse/DDC-2224 |
| Comment by Matthieu Napoli [ 08/Feb/13 ] |
|
The test is in this branch: https://github.com/myc-sense/doctrine2/tree/DDC-2290 |
[DDC-2275] [GH-568] Fixed plural variable names to singular when generating add or remove methods for entities Created: 04/Feb/13 Updated: 04/Feb/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of alexcarol: Url: https://github.com/doctrine/doctrine2/pull/568 Message: Changed generateEntityStubMethod so that variable names in add or remove methods are singular too Edited tests for EntityGenerator so that variable names are checked too |
[DDC-2264] Add support for custom Oracle SID / Service name in PDO_Oracle driver Created: 29/Jan/13 Updated: 29/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Michl Schmid | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | oracle | ||
| Description |
|
Some Oracle customer databases are set up having different settings for their "DBNAME" and "SID" / "SERVICE" property. (DBNAME != SID) So, hereing it's currently not possible to connect via the PDO_Oracle driver (Class: Doctrine\DBAL\Driver\PDOOracle\Driver) as it uses the DBNAME value by default as value for SID / SERVICE in the _constructPdoDsn() method. (DBNAME = SID) A solution would be to add an additional config param like "servicename" and pass it's value into _constructPdoDsn(). An updated version of the method could look like: private function _constructPdoDsn(array $params) if (isset($params['port'])) { $dsn .= '(PORT=' . $params['port'] . ')'; }else { $dsn .= '(PORT=1521)'; }if (isset($params['servicename']) && $params['servicename'] != '') { $servicename = $params['servicename']; }else { $servicename = $params['dbname']; }if (isset($params['service']) && $params['service'] == true) { $dsn .= '))(CONNECT_DATA=(SERVICE_NAME=' . $servicename . ')))'; }else { $dsn .= '))(CONNECT_DATA=(SID=' . $servicename . ')))'; }} else { $dsn .= 'dbname=' . $params['dbname']; }if (isset($params['charset'])) { $dsn .= ';charset=' . $params['charset']; } return $dsn; The only workaround for me is right now to use the "standard" PHP OCI / OCI8 functions with the correct SID / Service in it's DSN. |
[DDC-2249] Default value sequence Created: 19/Jan/13 Updated: 19/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Task | Priority: | Major |
| Reporter: | Maria | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Symfony 2, linux |
||
| Description |
|
I want to have a column on a table that by default it takes the value from a sequence. I've tried to do something like this:
But this doesn't work, it creates de sequence but not the link between the table column and the sequence. Is there any possibility to do something like this? Or any autoincrement default value instead? Thanks! |
[DDC-2239] Allow dynamic modification of select queries (either filter the AST or query) Created: 11/Jan/13 Updated: 11/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Nathanael Noblet | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I had built and used the following for doctrine 1: http://web.archive.org/web/20110705035547/http://www.doctrine-project.org/projects/orm/1.2/docs/cookbook/record-based-retrieval-security-template/en#record-based-retrieval-security-template I'd like to build something similar for D2 based projects. ocramius in IRC suggested a bug report/Improvement request. Figured that perhaps a custom event "dql_parse" or "ast_render" passing the AST or Query as a parameter. I'm under a tight timeline and am willing to pay for aid/feature implementation. |
[DDC-2223] unable to use scalar function when a scalar expression is expected Created: 04/Jan/13 Updated: 04/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexis Lameire | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | dql | ||
| Environment: |
(not affected by this bug) |
||
| Description |
|
the DQL Parser don't parse properly functions when a ScalarExpression is needed like of all case functions. In fact first function token is interpreted as a T_IDENTIFIER and enter on line 1663 of Doctrine\ORM\Query\Parser class. in search of math operator, when not found this case considere that the token is a row element with no considération of the functions procession treated after. fix of this bug consist to enclose the line 1672 by a if (!$this->_isFunction()). |
[DDC-2219] computeChangeSets array_merging for associationMappings problem ? Created: 02/Jan/13 Updated: 07/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | yohann.poli | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | unitofwork | ||
| Description |
|
Is this normal that when i call "$changeset = $unitOfWork->getEntityChangeSet($myObject);", it only return changes of root Object, all changes in sub collection (OneToMany) are less (not merging in the changeset) ? Is there an issue for that? |
| Comments |
| Comment by Marco Pivetta [ 02/Jan/13 ] |
|
Changesets of collections are computed separately from those of entities. |
| Comment by yohann.poli [ 02/Jan/13 ] |
|
Have to call the compute method for each collection of the entity ? |
| Comment by Benjamin Eberlei [ 06/Jan/13 ] |
|
Yes you have to, but this kind of operation seems weird. What are you trying to achieve. |
| Comment by yohann.poli [ 07/Jan/13 ] |
|
I manage a complex entity who have a collection entity (each entity in this collection have another collection entity) attributes and i need to now if the flush method has "really" execute an update. For example if the level 3 entity is update, i have to know in the root entity all changes apply in child... |
[DDC-2193] Named native query bug? Created: 11/Dec/12 Updated: 31/Dec/12 |
|
| Status: | Awaiting Feedback |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | dingdangjyz | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
@NamedNativeQueries is a useful thing, but I have found some problems during my using.
/**
* @NamedNativeQueries({
* @NamedNativeQuery(
* name = "fetchMultipleJoinsEntityResults",
* resultSetMapping= "mappingMultipleJoinsEntityResults",
* query = "SELECT * FROM test "
* )
* })
*/
2、Error,cannot connect to the server
/**
* @NamedNativeQueries({
* @NamedNativeQuery(
* name = "fetchMultipleJoinsEntityResults",
* resultSetMapping= "mappingMultipleJoinsEntityResults",
* query = "SELECT *
FROM test "
* )
* })
*/
3、Cannot use alias.The same problem as the second one.
.......
query = "SELECT a as test FROM test "
|
| Comments |
| Comment by Fabio B. Silva [ 12/Dec/12 ] |
|
Hi Doctrine does not change the native query at all Could you provide more details please? Cheers |
| Comment by dingdangjyz [ 13/Dec/12 ] |
|
Doctrine\Common\Lexer.php Hello, after checking, I found the problem should be here. As long as SQL wrap, or fill in alias, it will be error. It seems to be the preg_split problem?
$flags = PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_OFFSET_CAPTURE;
$matches = preg_split($regex, $input, -1, $flags);
foreach ($matches as $match) {
// Must remain before 'value' assignment since it can change content
$type = $this->getType($match[0]);
$this->tokens[] = array(
'value' => $match[0],
'type' => $type,
'position' => $match[1],
);
|
| Comment by Fabio B. Silva [ 13/Dec/12 ] |
|
Hi Could you try to add a failing test case please ? Cheers |
| Comment by dingdangjyz [ 14/Dec/12 ] |
|
xp php5.3.8 Apache
<?php
namespace Models\Entities;
/**
* @Entity
* @Table
*
* @NamedNativeQueries({
* @NamedNativeQuery(
* name = "find-hotel-item",
* resultSetMapping = "mapping-find-item",
* query = "SELECT Top 1 VEI_SN AS SN
FROM tourmanager.dbo.VEndorInfo vi
INNER JOIN tourmanager.dbo.VEndorInfo2 vi2 ON
vi.VEI_SN = vi2.VEI2_VEI_SN LEFT OUTER JOIN tourmanager.dbo.HotelInfo hi
ON hi.hotelid = vi2.VEI2_VEI_SN INNER JOIN tourmanager.dbo.HotelInfo2
hi2 ON hi2.hotelid = vi2.VEI2_VEI_SN AND hi2.LGC = 1 "
* )
* })
*
* @SqlResultSetMappings({
* @SqlResultSetMapping(
* name = "mapping-find-item",
* entities= {
* @EntityResult(
* entityClass = "HTHotelItem",
* fields = {
* @FieldResult(name = "id", column="SN")
* }
* )
* }
* )
* })
*
*/
class HTHotelItem{
/** @Id @Column(type="integer") @GeneratedValue */
protected $id;
/** @name */
protected $name;
/** @city */
protected $city;
/** @url */
protected $url;
public static function loadMetadata(\Doctrine\ORM\Mapping\ClassMetadataInfo $metadata){
$metadata->addNamedNativeQuery(array(
'name' => 'find-hotel-item',
'query' => 'SELECT h FROM HTHotelItem h',
'resultSetMapping' => '\\Models\\Entities\\HTHotelItem'
));
}
function getId(){
return $this->id;
}
function getName(){
return $this->name;
}
function getCity(){
return $this->city;
}
function getUrl(){
return $this->url;
}
}
|
| Comment by dingdangjyz [ 14/Dec/12 ] |
|
@NamedNativeQueries query If we write the long SQL, it will be fault. NO error massage. |
| Comment by Fabio B. Silva [ 16/Dec/12 ] |
|
Can't reproduce, Could you try to change the attached test case and make it fail. Cheers |
| Comment by Benjamin Eberlei [ 24/Dec/12 ] |
|
The Doctrine\Common\Lexer is never used in combination with native queries, only with the Annotation Parser, so i cannot be the preg_split that causes your SQL to be broken. Or do you get annotation errors? Also what database are you using? maybe its related to the DBAL sql parsing? |
| Comment by dingdangjyz [ 31/Dec/12 ] |
|
I'm sorry my English is too bad. I think it's Doctrine \ is \ Lexer. PHP preg_split the function of the problem in this file. |
[DDC-2183] Second Level Cache improvements Created: 03/Dec/12 Updated: 03/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Hibernate has a second level cache feature that is much more advanced than Doctrines result cache. With NoSQL in-memory databases such as Riak or MongoDB we could need a much more powerful cache to make Doctrine faaaaaasst. This ticket tracks the design and implementation of that feature. |
[DDC-2184] [GH-530] Singular form of generated methods should end with 'y' when property ends with 'ies' Created: 04/Dec/12 Updated: 06/Jan/13 |
|
| Status: | In Progress |
| Project: | Doctrine 2 - ORM |
| Component/s: | Tools |
| Affects Version/s: | 2.3 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
In Doctrine 2.3 the 'add' and 'remove' methods in oneToMany associations have another problem (in earlier versions like 2.2 this worked correct). The singular form is not correctly detected if the property ends with 'ies' like 'entries' which should be transformed to 'entry'.
Archive:
type: entity
fields:
id:
id: true
type: integer
unsigned: false
nullable: false
generator:
strategy: IDENTITY
oneToMany:
entries:
targetEntity: Entry
mappedBy: archive
This generates these methods: public function addEntrie(\Entry $entries) { ... } public function removeEntrie(\Entry $entries) { ... } Because in the EntityGenerator only the plural 's' is removed. It would be nice if an ending of 'ies' could be replaced by 'y'. So that we get these methods public function addEntry(\Entry $entries) { ... } public function removeEntry(\Entry $entries) { ... } My fork already has the changes https://github.com/naitsirch/doctrine-orm2/commit/a3adfccb4927d61da7debae46ed0fff61e4212f8 |
| Comments |
| Comment by Christian Stoller [ 04/Dec/12 ] |
|
Sorry, I accidently clicked on the button 'Request Feedback' |
| Comment by Benjamin Eberlei [ 06/Jan/13 ] |
|
Mark as improvement |
[DDC-2185] Better explain DQL "WITH" and implications for the collection filtering API Created: 04/Dec/12 Updated: 17/Dec/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation, DQL |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Matthias Pigulla | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | collection, documentation, dql, filtering | ||
| Description |
|
Available documentation is a bit thin regarding the "WITH" clause on JOIN expressions. Only a single example is provided in WITH seems to allow to only "partially" load a collection, so the collection in memory does not fully represent the associations available in the database. The resulting collection is marked as "initialized" and it seems there is no way to tell later on whether/how (with which expression) the collection has been initialized. When using the collection filtering API, the "initialized" flag on the collection will lead to in-memory processing. If a collection has been loaded WITH a restricting clause and another filter is applied later, results may not be what one might expect. I assume this is by design (no idea how the collection could be "partially" loaded and behave correctly under all conditions), so filing it as a documentation issue. |
| Comments |
| Comment by Matthias Pigulla [ 17/Dec/12 ] |
|
An additional observation: If you eager-load a collection using WITH, for the resulting entities that collection is marked as initialized as described above. Should you happen to come across the same entity during hydration in another (later) context where you explicitly eager load the same association without the WITH restriction (or with another one), the collection on that (existing) entity won't be re-initialized and still contains the associated objects found during the first query. |
[DDC-2170] Decorator base classes for query related objects Created: 26/Nov/12 Updated: 26/Nov/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Lars Strojny | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Doctrine\ORM\Query should not be directly extendable but it would be nice to decorate query objects and add additional methods. Use cases are e.g. doctrine-fun (see https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php) or even cases where users want to add domain specific methods. As Doctrine\ORM\Query is final it is not so easy to decorate correctly. I would propose:
|
| Comments |
| Comment by Lars Strojny [ 26/Nov/12 ] |
|
Related: |
[DDC-2166] Improve Identifier hashing in IdentiyMap Created: 25/Nov/12 Updated: 25/Nov/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
There are currently some drawbacks with identifier hashing:
There is a PR by goetas (https://github.com/doctrine/doctrine2/pull/232) that solves some issues, however adds a performance hit. We should move the conditional logic of this code out and use a strategy pattern to improve both performance and robustness of this code. |
[DDC-2154] Traits and Code Generation Created: 18/Nov/12 Updated: 18/Nov/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
See https://github.com/doctrine/DoctrineBundle/issues/106#issuecomment-10479116 |
[DDC-2141] Query should not be final Created: 13/Nov/12 Updated: 13/Nov/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Tarjei Huse | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
All |
||
| Description |
|
The Query class should not be marked final as this makes it impossible to Mock it. |
[DDC-1099] Tutorial :: Getting started code sample entity manager Created: 04/Apr/11 Updated: 11/Jul/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Gordon Franke | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
see pull request 24 on github.com |
| Comments |
| Comment by Michael Ridgway [ 11/Jul/11 ] |
|
This issue should be closed: https://github.com/doctrine/orm-documentation/pull/24 |
[DDC-1088] Description for SequenceGenerator annotation options is wrong Created: 30/Mar/11 Updated: 30/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.x |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Alexandre Mathieu | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
N/A |
||
| Description |
|
On paragraph 4.8.1.1 SequenceGenerator, the correct example should be: <?php
|
[DDC-1089] Annotations reference examples are inaccurate and confusing Created: 30/Mar/11 Updated: 30/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Maarten van Leeuwen | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
N.A. |
||
| Description |
|
In chapter 19 of the reference guide some coding examples seem to be inaccurate or incorrect. Especially when it comes to the bidirectional many-to-many associations, this might be confusing. Example:
Some other code fragments in chapter 19 have similar issues. I think they could easily be replaced by the examples from the earlier chapters, like for the bidirectional man-to-many association the example from chapter 5: |
[DDC-1072] Private property mapping can cause issues, suggest changing to protected Created: 17/Mar/11 Updated: 17/Mar/11 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.0.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Kevin Bradwick | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
not applicable |
||
| Description |
|
The documentation recommends using private variables in entities. This can be problematic on entities with relations when using caching drivers as the proxy objects cannot access private variables and so the caching driver can throw notices like ...apc_store(): "_id" returned as member variable from __sleep() but Making member variables protected resolves this issue when caching is enabled. This information would be helpful on the documentation so others can be made aware of this issue. We spent a few days trying to debug the issue before understanding exactly what was going on. |
[DDC-1738] Allow multiple Generators per class Created: 29/Mar/12 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.4 |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Guilherme Blanco | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
We should be able to support multiple generators per class. Currently we only support 1 generator per class. |
[DDC-1739] [GH-314] [WIP] Doctrine\Common metadata drivers reuse Created: 30/Mar/12 Updated: 07/Apr/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of Ocramius: Url: https://github.com/doctrine/doctrine2/pull/314 Message: This PR is strictly related with https://github.com/doctrine/common/pull/98 and tests won't pass until the doctrine-common submodule points to a merged version of it (will do so later, so please don't merge now ). Basically, I just stripped any code duplicate of what already available in dcom master under Doctrine\Common\Persistence\Mapping\Driver. Tests are OK on my environment when using the new commons submodule. (This is a cleanup for #263, where I sadly did pull from the remote branch after rebasing) Tests are still failing. |
| Comments |
| Comment by Benjamin Eberlei [ 30/Mar/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 30/Mar/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 30/Mar/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 30/Mar/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 01/Apr/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 04/Apr/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 06/Apr/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
| Comment by Benjamin Eberlei [ 07/Apr/12 ] |
|
A related Github Pull-Request [GH-314] was synchronize |
[DDC-1732] Unserialized non-initialized proxy classes should throw an exception when a method is called Created: 28/Mar/12 Updated: 28/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2, Git Master |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Morel | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
When we serialize entities in a session, we often have pointers to uninitialized proxies. The problem is that if you happen to call by mistake a method on such a proxy, you're not aware that this is an uninitialized proxy, and the business methods are called, with null values for every property. I think the proxy should throw an exception in that case. |
[DDC-1728] There is no exact alternative function like MONTH in mysql Created: 27/Mar/12 Updated: 27/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | DQL, ORM |
| Affects Version/s: | 2.2.0-RC1, 2.2, 2.2.1 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Sudheesh MS | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 11.10 |
||
| Description |
|
i am not able to extract only month from the date field using doctrine2 using 'MONTH' function |
[DDC-1729] Translate queries into graphs of value objects (instead of array hydration?) Created: 27/Mar/12 Updated: 09/Jun/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | 2.x |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In decoupled applications the model layer returns "data-transfer-objects" through the boundary into the controller/view layer. It would make sense to have Doctrine directly generate any data-transfer/value-object from native and dql queries. |
| Comments |
| Comment by Benjamin Eberlei [ 09/Jun/12 ] |
|
Example: $dql = "SELECT new CustomerAddressView(c.id, c.name, a.id, a.street, a.number, a.city, a.code)
FROM Customer c INNER JOIN c.address a WHERE c.id = ?1";
This supersedes DDC-1819. 1. One additional property in ResultSetMapping => $viewModelClass? |
[DDC-1721] LIKE clausule should accept functions on the pattern Created: 21/Mar/12 Updated: 24/Jan/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.6 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Ignacio Larranaga | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
Example: should be a valid SQL, now is rejected because the walker only accept a variable or an string expression. I'm adding a patch to address this. |
| Comments |
| Comment by Ignacio Larranaga [ 21/Mar/12 ] |
|
Sorry the Parser has to be modified also to allow expressions to be recognized, I'm attaching the necessary patch. |
| Comment by Benjamin Eberlei [ 22/Mar/12 ] |
|
I am sure there is a reason why the walker doesn't accept this such as not all supported vendors allowing functions in right hand side LIKE expressions, but i am not sure about this. |
| Comment by Glen Ainscow [ 03/Oct/12 ] |
|
This is not possible either: WHERE CASE WHEN p.name IS NULL THEN u.username ELSE p.name END LIKE :name |
| Comment by Thomas Mayer [ 24/Jan/13 ] |
|
In my case it worked when using "=" instead of "LIKE". //works: //[Syntax Error] line 0, col 1217: Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE' So the LIKE operator only needs to be allowed here. I'm wondering which vendor should not be able to handle that: |
[DDC-1723] Custom ID Generators Created: 22/Mar/12 Updated: 20/Sep/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.4 |
| Security Level: | All |
| Type: | New Feature | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Allow specify custom id generators, pull request is GH-206 https://github.com/doctrine/doctrine2/pull/206 |
[DDC-1714] Prevent inverse side lazy loading owning side of the oneToOne relationsip if owning side's id is an assosiationKey of inversed side Created: 18/Mar/12 Updated: 18/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | David | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue was originally discussed in http://www.doctrine-project.org/jira/browse/DDC-357 Say there is User and UserData with oneToOne bidirectional relationship. When we fetch User objects, UserData is lazy loaded right away. If we were to set UserData 's id as asssosiationKey of User, then user_id becomes the id of UserData and User object can already know that UserData owning side's id will equal it's own User->id. Can this be implemented? |
[DDC-1720] SqlWalter private variables should be protected to allow walker extensions Created: 21/Mar/12 Updated: 21/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.6 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Ignacio Larranaga | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
I'm attaching a patch with the suggestion. |
[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-1702] EBNF for IN expressions should be updated for 2.2 Created: 13/Mar/12 Updated: 13/Mar/12 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | Documentation |
| Affects Version/s: | 2.2 |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Documentation | Priority: | Major |
| Reporter: | Patrick Schwisow | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Description |