Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-790

Generating entities with cli failed on inheritated entities due missing PK

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-BETA4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Kubuntu lucid lynx

      Description

      While generating entities with:

      ./doctrine orm:generate-entities --generate-methods=true ../tmp/entities

      getting MappingException: No identifier/primary key specified for Entity 'Entities\Admin'. Every Entity must have an identifier/primary key.

      Admin is class inheritated, definition included:

      Person: http://pastebin.com/5r9fXrAu
      Admin: http://pastebin.com/51BcRZWZ

        Activity

        Eduard Kracmar created issue -
        Eduard Kracmar made changes -
        Field Original Value New Value
        Description While generating entities with:

        ./doctrine orm:generate-entities --generate-methods=true ../tmp/entities

        getting MappingException: No identifier/primary key specified for Entity 'Entities\Admin'. Every Entity must have an identifier/primary key.

        Admin is class inheritated, definition included:


        /**
         * Admin
         * @author kraken
         */

        /**
         * @entity
         * @table(name="admins")
         */
        class Admin extends Person {
            /**
             * Addons
             */
            /**
             * Events
             */
            /**
             * Getters and setters
             */
        }



        /**
         * Person
         * @author kraken
         */

        /**
         * @entity
         * @inheritanceType("JOINED")
         * @discriminatorColumn(name="role_discr", type="string")
         * @discriminatorMap({"Developer" = "Entities\Developer", "Superadmin" = "Entities\Superadmin", "Admin" = "Entities\Admin", "Installer" = "Entities\Installer", "User" = "Entities\User"})
         * @table(name="persons")
         * @hasLifecycleCallbacks
         * @abstract
         */
        abstract class Person extends \DannaxTools\BaseEntity {

            /**
             * @id
             * @column(type="integer")
             * @generatedValue(strategy="SEQUENCE")
             */
            private $id;
            /**
             * @ManyToOne(targetEntity="Person")
             * @JoinColumn(name="id_creator", referencedColumnName="id", nullable=true)
             */
            private $creator;
            /**
             * @ManyToOne(targetEntity="Role")
             * @JoinColumn(name="id_role", referencedColumnName="id", nullable=false)
             */
            private $role;
            /**
             * @column(type="string", length=200, nullable=false, unique=true)
             */
            private $email;
            /**
             * @column(type="string", length=200, nullable=false)
             */
            private $firstName;
            /**
             * @column(type="string", length=200, nullable=false)
             */
            private $password;
            /**
             * @column(type="string", length=200, nullable=false)
             */
            private $lastName;
            /**
             * @column(type="boolean", nullable=false)
             */
            private $active;
            /**
             * @column(type="datetime", nullable=false)
             */
            private $modified;
            /**
             * @column(type="datetime", nullable=false)
             */
            private $created;



        While generating entities with:

        ./doctrine orm:generate-entities --generate-methods=true ../tmp/entities

        getting MappingException: No identifier/primary key specified for Entity 'Entities\Admin'. Every Entity must have an identifier/primary key.

        Admin is class inheritated, definition included:

        Person: http://pastebin.com/5r9fXrAu
        Admin: http://pastebin.com/51BcRZWZ
        Benjamin Eberlei made changes -
        Assignee Roman S. Borschel [ romanb ] Jonathan H. Wage [ jwage ]
        Jonathan H. Wage made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 11886 ] jira-feedback [ 14568 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14568 ] jira-feedback2 [ 16432 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16432 ] jira-feedback3 [ 18685 ]

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Eduard Kracmar
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: