title: Doctrine2 Primary Key
body: <p>This is my Doctrine2 Annotation file, which is returning me this error</p>
  
  <blockquote>
    <p>MappingException: No identifier/primary key specified for Entity
    "WbsGo\clientsBundle\Entity\VtigerPortalinfo". Every Entity must have
    an identifier/primary key.</p>
  </blockquote>
  
  <p>In DB, the field ID is set to Primary Key... So I don't know where is the problem....</p>
  
  <pre><code>&lt;?php
  
  namespace WbsGo\clientsBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * VtigerPortalinfo
   */
  class VtigerPortalinfo
  {
      /**
       * @var string
       */
      private $userName;
  
      /**
       * @var string
       */
      private $userPassword;
  
      /**
       * @var string
       */
      private $type;
  
      /**
       * @var \DateTime
       */
      private $lastLoginTime;
  
      /**
       * @var \DateTime
       */
      private $loginTime;
  
      /**
       * @var \DateTime
       */
      private $logoutTime;
  
      /**
       * @var integer
       */
      private $isactive;
  
      /**
       * @var \WbsGo\clientsBundle\Entity\VtigerContactdetails
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
  
      /**
       * Set userName
       *
       * @param string $userName
       * @return VtigerPortalinfo
       */
      public function setUserName($userName)
      {
          $this-&gt;userName = $userName;
  
          return $this;
      }
  
      /**
       * Get userName
       *
       * @return string 
       */
      public function getUserName()
      {
          return $this-&gt;userName;
      }
  
      /**
       * Set userPassword
       *
       * @param string $userPassword
       * @return VtigerPortalinfo
       */
      public function setUserPassword($userPassword)
      {
          $this-&gt;userPassword = $userPassword;
  
          return $this;
      }
  
      /**
       * Get userPassword
       *
       * @return string 
       */
      public function getUserPassword()
      {
          return $this-&gt;userPassword;
      }
  
      /**
       * Set type
       *
       * @param string $type
       * @return VtigerPortalinfo
       */
      public function setType($type)
      {
          $this-&gt;type = $type;
  
          return $this;
      }
  
      /**
       * Get type
       *
       * @return string 
       */
      public function getType()
      {
          return $this-&gt;type;
      }
  
      /**
       * Set lastLoginTime
       *
       * @param \DateTime $lastLoginTime
       * @return VtigerPortalinfo
       */
      public function setLastLoginTime($lastLoginTime)
      {
          $this-&gt;lastLoginTime = $lastLoginTime;
  
          return $this;
      }
  
      /**
       * Get lastLoginTime
       *
       * @return \DateTime 
       */
      public function getLastLoginTime()
      {
          return $this-&gt;lastLoginTime;
      }
  
      /**
       * Set loginTime
       *
       * @param \DateTime $loginTime
       * @return VtigerPortalinfo
       */
      public function setLoginTime($loginTime)
      {
          $this-&gt;loginTime = $loginTime;
  
          return $this;
      }
  
      /**
       * Get loginTime
       *
       * @return \DateTime 
       */
      public function getLoginTime()
      {
          return $this-&gt;loginTime;
      }
  
      /**
       * Set logoutTime
       *
       * @param \DateTime $logoutTime
       * @return VtigerPortalinfo
       */
      public function setLogoutTime($logoutTime)
      {
          $this-&gt;logoutTime = $logoutTime;
  
          return $this;
      }
  
      /**
       * Get logoutTime
       *
       * @return \DateTime 
       */
      public function getLogoutTime()
      {
          return $this-&gt;logoutTime;
      }
  
      /**
       * Set isactive
       *
       * @param integer $isactive
       * @return VtigerPortalinfo
       */
      public function setIsactive($isactive)
      {
          $this-&gt;isactive = $isactive;
  
          return $this;
      }
  
      /**
       * Get isactive
       *
       * @return integer 
       */
      public function getIsactive()
      {
          return $this-&gt;isactive;
      }
  
      /**
       * Set id
       *
       * @param \WbsGo\clientsBundle\Entity\VtigerContactdetails $id
       * @return VtigerPortalinfo
       */
      public function setId(\WbsGo\clientsBundle\Entity\VtigerContactdetails $id = null)
      {
          $this-&gt;id = $id;
  
          return $this;
      }
  
      /**
       * Get id
       *
       * @return \WbsGo\clientsBundle\Entity\VtigerContactdetails 
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  }
  </code></pre>