DDC-150: Discriminator column is lost when persisting entity. #187

Closed
opened 2026-01-22 12:29:56 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 16, 2009).

Jira issue originally created by user rickdt:

The discriminator value column is lost after querying on an object.

Look at case DDC-149 for detailled entities.

Before this, $rev_type field equal "HEAD". After, it is empty string.

$qb = new \Doctrine\ORM\QueryBuilder($em);
        $qb->select('fna')
            ->from('Entity\FNA', 'fna')
            ->andwhere($qb->expr()->eq('fna.id', ':fna_id'));
        $qb->setParameter('fna_id', 1);
        $query = $qb->getQuery();

        $fna = $query->getSingleResult();
        $em->flush();
Originally created by @doctrinebot on GitHub (Nov 16, 2009). Jira issue originally created by user rickdt: The discriminator value column is lost after querying on an object. Look at case [DDC-149](http://www.doctrine-project.org/jira/browse/DDC-149) for detailled entities. Before this, $rev_type field equal "HEAD". After, it is empty string. ``` $qb = new \Doctrine\ORM\QueryBuilder($em); $qb->select('fna') ->from('Entity\FNA', 'fna') ->andwhere($qb->expr()->eq('fna.id', ':fna_id')); $qb->setParameter('fna_id', 1); $query = $qb->getQuery(); $fna = $query->getSingleResult(); $em->flush(); ```
admin added the Bug label 2026-01-22 12:29:56 +01:00
admin closed this issue 2026-01-22 12:29:57 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 16, 2009):

Comment created by rickdt:

This problem occurs only if a field is set with the same name that the discriminator field.

That was my mistake.

@doctrinebot commented on GitHub (Nov 16, 2009): Comment created by rickdt: This problem occurs only if a field is set with the same name that the discriminator field. That was my mistake.
Author
Owner

@doctrinebot commented on GitHub (Nov 16, 2009):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Nov 16, 2009): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#187