Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: Git Master
-
Fix Version/s: 2.1
-
Component/s: Mapping Drivers
-
Security Level: All
-
Labels:None
-
Environment:Apache 2.2.16
PHP 5.3.3
Ubuntu 11
Description
Hi all,
After updating today Doctrine 2 from master branch I'm getting:
Entity of type "Entity" is missing an assigned ID. The identifier generation strategy for this entity requires the ID field to be populated before EntityManager#persist() is called. If you want automatically generated identifiers instead you need to adjust the metadata mapping accordingly.
Was there a change on the mapping of ID generation strategy? I was using a commit of the master branch from 1 o 2 weeks ago and it was working ok. I took a look at the repo for changes on the last days but I couldn't find anything related to this.
I paste the mapping and entities here:
Element:
/** * @ORM\MappedSuperclass */ abstract class Element { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; }
File:
/** * @ORM\Entity * @ORM\Table(name="file") * @ORM\InheritanceType("JOINED") * @ORM\DiscriminatorColumn(name="discriminator", type="string") * @ORM\DiscriminatorMap({ "image" = "Image", }) */ abstract class File extends Element { // Fields }
And Image:
/** * @ORM\Entity * @ORM\Table(name="image") */ class Image extends File { // Fields }
Thanks in advance!
Do you "use" the mapping AS ORM namespace?