I attached a mapping class and a test. There really isn't much to it, I just create a Lead object and try to save it. Here are create statements for the tables: – Create syntax for TABLE 'lead' CREATE TABLE `lead` ( `leadid` int(11) unsigned NOT NULL AUTO_INCREMENT, PRIMARY KEY (`leadid`) ) ENGINE=InnoDB AUTO_INCREMENT=645275 DEFAULT CHARSET=latin1; – Create syntax for TABLE 'leadduplicate' CREATE TABLE `leadduplicate` ( `leadduplicateid` int(11) unsigned NOT NULL AUTO_INCREMENT, `parentleadid` int(11) unsigned NOT NULL, `childleadid` int(11) unsigned NOT NULL, PRIMARY KEY (`leadduplicateid`), UNIQUE KEY `parentleadid_childleadid` (`parentleadid`,`childleadid`), UNIQUE KEY `childleadid` (`childleadid`), UNIQUE KEY `UK_cp1j5s8ptinoxyfwsdfefxmnr` (`childleadid`), CONSTRAINT `FK5308xiscl12o5gkdc4pgp6ftp` FOREIGN KEY (`childleadid`) REFERENCES `lead` (`leadid`), CONSTRAINT `FKa5c7ylhng76q448id4c94ujkv` FOREIGN KEY (`parentleadid`) REFERENCES `lead` (`leadid`) ) ENGINE=InnoDB AUTO_INCREMENT=50740 DEFAULT CHARSET=latin1; |