Jira issue originally created by user dator:
I think i found a little bug with doctrine and the inheritance on differente Symfony2 Bundle.
Here is the pb :
I use the DoctrineUserBundle (https://github.com/knplabs/DoctrineUserBundle) for one of my testing application, it's provide a nice way to handle user and session management trough a Symfony2 app.
I create an DoctrineUserBundle in my own Application Folder and I create an User sub class that inherit the User base class in the bundle with the annotation way.
When I run the doctrine:generate:entities command it's telling me:
No identifier/primary key specified for Entity 'Application\DoctrineUserBundle\Entity\User'. Every Entity must have an identifier/primary key.
But the User (base class of DoctrineUserBundle) has a primary key but with the xml way.
Do you think it's a bug ?
Thanks a lot
Comment created by @beberlei:
Now i get it. This is not a bug.
You cannot mix mappings from annotations and xml to define a single entity mapping. Its not possible.
One Solution would be to add annotations to the User bae class. That would have to be on the DoctrineUserBundle then.
Comment created by dator:
Ok ! Thanks but one thing is that the creator of this bundle (ornicar) has created a website called lichess.org and use DoctrineUserBundle.
In this app, he created a User.php sub classing the Base User of DoctrineUserBundle and he used annotations but with mongodb :)
How it's possible that it works with ODM and not with ORM ? :)
THanks a lot for your time :)
Hm maybe its a bug with mapped superclasses. I thought Ornicar did a little hack there regarding mixing.
But in general ORM != ODM.
That bug happens when the Doctrine UserBundle is not detected correctly.
It should be fixed with the current Symfony2 state of code.
Issue was closed with resolution "Invalid"
Comment created by jackbravo:
So now we are able to mix mappings or something else was fixed.
Because right now I'm getting the same error using latest symfony-sandbox code.
read the master docs of symfony2 please, there was a change in configuration: