Search code examples
javamysqlhibernateintellij-ideamodels

Relationship References disbled table while generating model through intellij hibernate persistence tool


I have a table created on mysql with following sql

CREATE TABLE `ssk_cms_category_transaction_type_relation` (
  `categoryId` int(11) NOT NULL,
  `typeId` int(11) NOT NULL,
  `createdTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`categoryId`,`typeId`),
  KEY `FK_ssk_cms_category_transaction_type_relation1` (`typeId`),
  CONSTRAINT `FK_ssk_cms_category_transaction_type_relation` FOREIGN KEY (`categoryId`) REFERENCES `ssk_cms_content_category` (`contentCategoryId`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_ssk_cms_category_transaction_type_relation1` FOREIGN KEY (`typeId`) REFERENCES `ssk_transaction_type` (`typeId`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1

While trying to generate its model using hibernate persistence tool in intellij, if I check on show default relationships I get the following error, can anyone help me out in understanding this. I tried googling but no solution found enter image description here


Solution

  • The message tells that mentioned relations of the ssk_cms_category_transa... table reference another table which is not included into the model generation. So you should select this another table including it into generation to avoid the error.