Andrus Adamchik created CAY-2977:
------------------------------------

             Summary: DBImport confused by multi-key relationships
                 Key: CAY-2977
                 URL: https://issues.apache.org/jira/browse/CAY-2977
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 5.0-M2
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
             Fix For: 5.0-M3


On PostgreSQL, for a given schema:
{noformat}
CREATE TABLE t1 (
    id1 INT NOT NULL,
    id2 text NOT NULL,
    title text,
    PRIMARY KEY (id1, id2)
);
CREATE TABLE t2 (
    id INT PRIMARY KEY,
    t1_id1 INT NOT NULL,
    t1_id2 text NOT NULL,
    FOREIGN KEY (t1_id1, t1_id2) REFERENCES t1 (id1, id2)
);
 {noformat}
DB import creates two independent relationships instead of a single one with 
two joins.

This is a pretty serious bug and seems to go all the way back. I wonder why we 
didn't catch it before (is it PG only?)

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to