DDC-627: Unexpected Duplicate Field Mapping Exception #774

Closed
opened 2026-01-22 12:50:01 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 7, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user alexbrina:

Trying to generate entities with annotation mappings using the CLI orm:convert-mapping command will throw an exception.

-- Schema to reproduce
CREATE DATABASE IF NOT EXISTS doctrine_issue;
USE doctrine_issue;
CREATE TABLE activity (
idact int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (idact)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE activity_log (
idacl int(10) unsigned NOT NULL AUTO_INCREMENT,
idact int(10) unsigned NOT NULL,
PRIMARY KEY (idacl),
CONSTRAINT fk*activity_data*activity FOREIGN KEY (idact) REFERENCES activity (idact)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

// configure a simple doctrine.php file to connect and run the following CLI command:
C:>php doctrine.php orm:convert-mapping --from-database annotation .\Entities

Will throw an MappingException::duplicateFieldMapping on ActivityLog::idact, at line 1064 of class Doctrine\ORM\Mapping\ClassMetadataInfo

Originally created by @doctrinebot on GitHub (Jun 7, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user alexbrina: Trying to generate entities with annotation mappings using the CLI orm:convert-mapping command will throw an exception. -- Schema to reproduce CREATE DATABASE IF NOT EXISTS `doctrine_issue`; USE `doctrine_issue`; CREATE TABLE `activity` ( `idact` int(10) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`idact`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `activity_log` ( `idacl` int(10) unsigned NOT NULL AUTO_INCREMENT, `idact` int(10) unsigned NOT NULL, PRIMARY KEY (`idacl`), CONSTRAINT `fk*activity_data*activity` FOREIGN KEY (`idact`) REFERENCES `activity` (`idact`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; // configure a simple doctrine.php file to connect and run the following CLI command: C:>php doctrine.php orm:convert-mapping --from-database annotation .\Entities Will throw an MappingException::duplicateFieldMapping on ActivityLog::idact, at line 1064 of class Doctrine\ORM\Mapping\ClassMetadataInfo
admin added the Bug label 2026-01-22 12:50:01 +01:00
admin closed this issue 2026-01-22 12:50:02 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jun 7, 2010):

@doctrinebot commented on GitHub (Jun 7, 2010): - is referenced by [DDC-616: Reverse engineering with Oracle](http://www.doctrine-project.org/jira/browse/DDC-616)
Author
Owner

@doctrinebot commented on GitHub (Jun 13, 2010):

Comment created by @beberlei:

Fixed and scheduled for BETA 3

@doctrinebot commented on GitHub (Jun 13, 2010): Comment created by @beberlei: Fixed and scheduled for BETA 3
Author
Owner

@doctrinebot commented on GitHub (Jun 13, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jun 13, 2010): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Jun 2, 2011):

Comment created by cosmo:

Hi, I've got this exact issue in 2.1.0BETA1. Any idea how to work around it?

@doctrinebot commented on GitHub (Jun 2, 2011): Comment created by cosmo: Hi, I've got this exact issue in 2.1.0BETA1. Any idea how to work around it?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#774