telosystools

Open full view…

support self reference foreign key?

陳默默
Fri, 17 Apr 2015 03:22:35 GMT

I got a exception said not referenced table for foreign key 'ROD' while generate repository. I checked the table and figure out the 'ROD' key was a self-referenced key. my question is it's my bad or this tool not support self-reference key? CREATE TABLE DEPARTMENT ( DEPTNO CHARACTER(3) NOT NULL, DEPTNAME VARCHAR(36) NOT NULL, MGRNO CHARACTER(6), ADMRDEPT CHARACTER(3) NOT NULL, LOCATION CHARACTER(16), CONSTRAINT PK_DEPARTMENT PRIMARY KEY (DEPTNO), CONSTRAINT RDE FOREIGN KEY (MGRNO) REFERENCES EMPLOYEE (EMPNO) ON DELETE SET NULL, CONSTRAINT ROD FOREIGN KEY (ADMRDEPT) REFERENCES DEPARTMENT (DEPTNO) ON DELETE CASCADE );