Single id is not allowed on composite primary key in entity Doctrine error

You might get the above error on PHP Doctrine

if you got the above error, then it means you have two or more ids as primary in your object representing the table.


class Member
   /** @id 
    * @Column(type="integer") 
    * @GeneratedValue(strategy="AUTO")
   private $id;
   /** @id @Column(type="string") */
   private $key;

The above declaration would create the above error and taking out the generatedValue part can resolve the issue.

See the solution to common error of new entity was found though relation while using doctrine