B
B
BonBon Slick2021-03-12 23:31:51
Doctrine ORM
BonBon Slick, 2021-03-12 23:31:51

Doctrine Mapped Superclass index column ID not found on child table?

<mapped-superclass name="App\Domain\Token\Entity\AbstractToken">
        <embedded name="id" class="App\Domain\Core\ValueObjects\EntityId" use-column-prefix="false"/>
        <embedded name="secret" class="App\Domain\Token\ValueObject\TokenSecret" use-column-prefix="false"/>
// ok
...
  <entity name="App\Domain\Token\Entity\AnonToken">
        <indexes>
            <index name="token_search_index" columns="id,secret"/>
        </indexes>
    </entity>

If you remove the ID from the index, then the mapping is working.
class AbstractToken implements IAggregateRoot {
    public EntityId                      $id;
    private TokenSecret                     $secret;


It doesn't matter where I put the index, in mapped-superclass mapping or child mapping, it shows that the ID is not found, but sees the secret for the index, why?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question