[DDC-3893] Update statement on bool field with equal expression Created: 04/Sep/15  Updated: 04/Sep/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Alexander Schranz Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Want to run an update statement based on a expression.

e.g.: active specific `uc` and deactivate all others

Code:

{{
$queryBuilder = $this->getEntityManager()->createQueryBuilder();
$queryBuilder->update('TestBUndle', 'uc')
->set('uc.active', '(uc.collection = :collectionId)')
->where('uc.user = :userId');

$queryBuilder->setParameter('collectionId', $collectionId);
$queryBuilder->setParameter('userId', $userId);

$query = $queryBuilder->getQuery();
}}

DQL I get ($query->getDql()):

{{
UPDATE TestBundle:UserCollection uc
SET uc.active = (uc.collection = :collectionId) WHERE uc.user = :userId
}}

Error I get when run $query->getSql():

{{
[Syntax Error] line 0, col 81: Error: Expected
Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got '='
}}

SQL I want:

UPDATE user_collections AS uc SET uc.active = (uc.idCollections = 1) WHERE uc.idUsers = 74






[DDC-3885] Order by on ToMany collections with fetch=“EAGER” doesn't work Created: 02/Sep/15  Updated: 02/Sep/15

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: 2.5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Amarjeet Singh Rai Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: mapping, orm


 Description   

When using order by on ToMany collections with fetch="EAGER", order by isn't taken into account.

It works when you remove the EAGER fetch.

e.g. doesn't work:
<one-to-many target-entity="TopTenItem" mapped-by="list" field="items" fetch="EAGER">
<order-by>
<order-by-field name="position" direction="DESC"/>
</order-by>
</one-to-many>






Generated at Fri Sep 04 15:08:44 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.