[doctrine-user] Problem syncing schema MySQL/SQlite with DBAL/ORM

2014-10-02 Thread Andreas Goetz
Hello ORM/DBAL heroes, I'm having two minor troubles with the ORM 2.4.* and DBAL 2.3.* functions. I'm implementing a little database backup tool for our app (http://volkszaehler.org). Part of the functionality- which DBAL gracefully seems to offer- will be migrating from a MySQL DB to SQlite

[doctrine-user] DBAL-464 Error when removing primary key (DBAL 2.5.1 / MySQL)

2015-01-26 Thread Andreas Goetz
I have a table with a composite primary key. For historic reasons (pre DDC-117) this is implemented as a simple PK plus a unique index: /** * @Entity * @Table( * name=test, * uniqueConstraints={ * @UniqueConstraint(name=test_unique, columns={entity_id, pkey}) *

[doctrine-user] Re: DBAL-464 Error when removing primary key (DBAL 2.5.1 / MySQL)

2015-01-26 Thread Andreas Goetz
The problem is this: $diffTable-dropPrimaryKey(); $diffTable-setPrimaryKey(array('foo')); In MySqlPlatform-getPreAlterTableIndexForeignKeySQL the removedIndexes are checked for auto columns. As the primary index is dropped only to be added again, the auto column is not

[doctrine-user] [help] DQL query result problem when intermediate query run

2017-08-23 Thread Andreas Goetz
I have a simple ER diagram with entities and properties 1:n. Retrieving an entity by its uuid will also obtain all it's properties: $dql = 'SELECT a, p FROM Volkszaehler\Model\Entity a LEFT JOIN a.properties p WHERE a.uuid = :uuid'; $q = $em->createQuery($dql) ->setParameter('uuid', $uuid);

[doctrine-user] Re: [help] DQL query result problem when intermediate query run

2017-08-23 Thread Andreas Goetz
Update: I've found that using $this->em->refresh($entity); after the additional query does make the last query return all properties again. I still find this behaviour highly confusing. Why shouldn't the last query always return a fully populated entity instead of a partial object? Thanks,

[doctrine-user] Howto eagerly fetch association with discriminator map?

2017-10-14 Thread Andreas Goetz
I have Entites and Aggregators which are entities with children. When retrieving entities I'd like to eagerly fetch children for entities of type aggregator: $dql = 'SELECT e, p FROM Volkszaehler\Model\Entity e LEFT JOIN e.properties p WHERE e.uuid = :uuid'; $q =

Re: [doctrine-user] [help] DQL query result problem when intermediate query run

2017-08-26 Thread Andreas Goetz
Thanks for the clarification and for your time. Have updated the query to fully populate the entity. Best regards, Andreas On Friday, August 25, 2017 at 9:12:59 AM UTC+2, Marco Pivetta wrote: > > On Wed, Aug 23, 2017 at 9:29 AM, Andreas Goetz <cpu...@gmail.com > > wrote

[doctrine-user] Re: Howto eagerly fetch association with discriminator map?

2017-12-25 Thread Andreas Goetz
Unfortunately the problem still exists. Even updating the Aggregator children annotation like this: @ManyToMany(targetEntity="Entity", inversedBy="parents", fetch="EAGER") does not lead to the children being loaded eagerly. What am I doing wrong here? Thanks, Andreas -- You received

[doctrine-user] Re: Howto eagerly fetch association with discriminator map?

2017-12-25 Thread Andreas Goetz
I've had this on 2.5 already, and still on 2.6. But thank you for confirming that this should work even with a discriminator map- I'll need to continue investigation. Thanks, Andreas -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To