[DDC-627] Unexpected Duplicate Field Mapping Exception Created: 07/Jun/10  Updated: 02/Jun/11  Resolved: 13/Jun/10

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: None
Fix Version/s: 2.0-BETA3
Security Level: All

Type: Bug Priority: Major
Reporter: Alexandre Brina Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

mysql Ver 14.14 Distrib 5.1.43, for Win32 (ia32)

PHP 5.3.1 (cli) (built: Feb 8 2010 22:11:49)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

  • with Zend Debugger v5.3, Copyright (c) 1999-2010, by Zend Technologies [loaded] [licensed] [enabled]

Issue Links:
Reference
is referenced by DDC-616 Reverse engineering with Oracle Resolved

 Description   

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



 Comments   
Comment by Benjamin Eberlei [ 13/Jun/10 ]

Fixed and scheduled for BETA 3

Comment by Cosmo [ 02/Jun/11 ]

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

Generated at Wed Nov 26 12:59:52 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.