Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1281

ORM uses BasicEntityPersister instead of JoinedSubclassPersister on a JOINED inheritance

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Database server: Oracle 10, Debian
      PHP: 5.3.6
      Apache: 2.2.18 (Windows 7 Home Premium)

      Description

      Hi,
      I have these classes: https://gist.github.com/1085518/58b5424bc0ab5af1ae65421fe832e7a1b45533cf (read the comments to see the stracktrace)

      If I try:
      $entity = $em->find('Usuario', $id);
      $entity->getPessoaFisica()->getId();
      I got this error: Class does not exist.

      This is looking weird because, analyzing the stacktrace, the ORM loads the proxy through the BasicEntityPersister instead of JoinedSubclassPersister.

      I've been discussed about this on: http://groups.google.com/group/doctrine-user/browse_thread/thread/190dc2c4b768ae13#

      Regards,
      Daniel Lima

        Activity

        Hide
        Benjamin Eberlei added a comment -

        It seems your mappings are wrong, the @JoinColumn maps to a column named COD_PERFIL_USUARIO, but that is not the ID of the Joined Entity base class.

        Show
        Benjamin Eberlei added a comment - It seems your mappings are wrong, the @JoinColumn maps to a column named COD_PERFIL_USUARIO, but that is not the ID of the Joined Entity base class.
        Hide
        Daniel Lima added a comment -

        There was a wrong column definition on discriminator column:

        On the DATABASE was: CHAR(30).

        The hydrator filled discriminator column with "F " or "J " (with blank spaces), making it impossible to Discriminator map to locate the related classes.

        I think it´s a bug with OCI driver or Doctrine´s Hydrator.

        Show
        Daniel Lima added a comment - There was a wrong column definition on discriminator column: On the DATABASE was: CHAR(30). The hydrator filled discriminator column with "F " or "J " (with blank spaces), making it impossible to Discriminator map to locate the related classes. I think it´s a bug with OCI driver or Doctrine´s Hydrator.
        Hide
        Benjamin Eberlei added a comment -

        That is how oracle works. It right pads chars.

        Show
        Benjamin Eberlei added a comment - That is how oracle works. It right pads chars.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Daniel Lima
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: