[DBAL-51] "No identifier/primary key specified for Entity" problem, Doctrine Beta 3 cannot find primary key Created: 31/Aug/10 Updated: 27/Nov/10 Resolved: 27/Nov/10 |
|
| Status: | Resolved |
| Project: | Doctrine DBAL |
| Component/s: | Schema Managers |
| Affects Version/s: | 2.0.0-BETA4 |
| Fix Version/s: | 2.0.0-RC1-RC3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Minxuan GUO | Assignee: | Juozas Kaziukenas |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows xp, sql server 2008, php 5.3 |
||
| Description |
|
when execute php doctrine.php orm:convert-mapping --from-database annotation "Entities" get error message No identifier/primary key specified for Entity 'Classname(Tablename)'. Every Entity must have an identifier/primary key. For resolving this problem
in function "loadMetadataForClass" in \\Doctrine\ORM\Mapping\Driver\DatabaseDriver.php by
then the beta 3 works for my date base It is because doctrine look for $indexes['prime'] to construit the primary key in entities. when we use "$this->tables[$tableName] |
| Comments |
| Comment by Benjamin Eberlei [ 15/Sep/10 ] |
|
This is an error in the MSSQL SchemaManager, it is not correctly setting the primary = true key in the index retrieve method. I move that issue to DBAL and reassign to juokaz |
| Comment by Juozas Kaziukenas [ 14/Nov/10 ] |
|
I believe this is now fixed, but I'll test more https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Schema/MsSqlSchemaManager.php#L118 |
| Comment by Benjamin Eberlei [ 27/Nov/10 ] |
|
Fixed. |