Hi Jasper,

On 31 October 2014 08:48, 'Jasper N. Brouwer' via doctrine-user <
[email protected]> wrote:

> I'm running a little experiment:
>
> For a couple of tables I'm using a UUID as primary key. This UUID is
> stored in a BINARY(16) column. I've also implemented a custom UuidType,
> which strips out the dashes and converts the hex to binary (and the other
> way around). This part is working great.
>
> Now I have a bidirectional OneToMany association from an entity with UUID
> as Id, and another without. But Doctrine can't lazy-load the Collection
> properly. It remains empty. In a query logger I can see the custom type is
> probably not picked up:
>
> QUERY.DEBUG: SELECT t0.id AS id1, t0.type AS type2, t0.label AS label3,
> t0.status AS status4, t0.sort_order AS sort_order5, t0.assignment_id AS
> assignment_id6 FROM assignment_section t0 WHERE t0.assignment_id = ? ORDER
> BY t0.sort_order ASC
> {"params":["ff98ff019-2e84-afc8-e691-31c151c87ae"],"types":[null],"time":0.00038599967956543}
>
> The query logger shows "types":["uuid"] when fetching the root entity, so
> my guess this is where it goes wrong: It binds the string version of the
> UUID as parameter, which can't be found because the DB holds the binary
> version.
>
> I'm going to dive into the internals of Doctrine, but I wanted to ask:
>
> Is this a known limitation?
> Does loading associations ignore the custom type on purpose?
> If so, why was this done?
>
> PS: Using PHP v5.5.18, Doctrine ORM v2.4.6 and MariaDB v10.0.14
>

This looks like a bug to me: may want to abstract it into a test case and
see if it's still there.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to