Hello,
regarding "CSC-213  Add foreign keys afterwards in MySQL DDL."
I made following test case and I don't see which foreign keys are
missing in mysql.

Application MyApp {
    basePackage=org.f4s.s4cc

        Module core {
                Entity A {
                        String keyA1 key;
                        String keyA2 key;
                        - @B bcko;
                        - Set<@B> setBcko;
                        - Set<@B> setBckoInv inverse <-> bBackInv;
                        - Set<@B> setBckoOpo <-> bBack;
                }

                Entity B {
                        String keyB1 key;
                        String keyB2 key;
                        - Set<@A> bBackInv <-> setBckoInv;
                        - @A bBack <-> setBckoOpo;
                }
        }
}

-------------------------------------- Oracle
--------------------------------------
DROP TABLE A_SETBCKO CASCADE CONSTRAINTS;

DROP TABLE BBACKINV_SETBCKOINV CASCADE CONSTRAINTS;


DROP TABLE A CASCADE CONSTRAINTS;

DROP TABLE B CASCADE CONSTRAINTS;



drop sequence hibernate_sequence;


create sequence hibernate_sequence;



CREATE TABLE B (
  ID NUMBER(20) NOT NULL,
  KEYB1 VARCHAR2(100) NOT NULL,
  KEYB2 VARCHAR2(100) NOT NULL,
  CREATEDDATE DATE,
  CREATEDBY VARCHAR2(50),
  LASTUPDATED DATE,
  LASTUPDATEDBY VARCHAR2(50),
  VERSION NUMBER(20) NOT NULL  ,
  BBACK NUMBER(20) NOT NULL

);

CREATE TABLE A (
  ID NUMBER(20) NOT NULL,
  KEYA1 VARCHAR2(100) NOT NULL,
  KEYA2 VARCHAR2(100) NOT NULL,
  CREATEDDATE DATE,
  CREATEDBY VARCHAR2(50),
  LASTUPDATED DATE,
  LASTUPDATEDBY VARCHAR2(50),
  VERSION NUMBER(20) NOT NULL  ,
  BCKO NUMBER(20) NOT NULL

);


CREATE TABLE BBACKINV_SETBCKOINV (
  SETBCKOINV NUMBER(20) NOT NULL,
  BBACKINV NUMBER(20) NOT NULL

);

CREATE TABLE A_SETBCKO (
  SETBCKO NUMBER(20) NOT NULL,
  A NUMBER(20) NOT NULL

);



ALTER TABLE B ADD CONSTRAINT PK_B
        PRIMARY KEY (ID)
;

ALTER TABLE A ADD CONSTRAINT PK_A
        PRIMARY KEY (ID)
;


ALTER TABLE BBACKINV_SETBCKOINV ADD CONSTRAINT PK_BBACKINV_SETBCKOINV
        PRIMARY KEY (SETBCKOINV, BBACKINV)
;

ALTER TABLE A_SETBCKO ADD CONSTRAINT PK_A_SETBCKO
        PRIMARY KEY (SETBCKO, A)
;


ALTER TABLE B
        ADD CONSTRAINT UQ_B UNIQUE (KEYB1, KEYB2)
        
;
ALTER TABLE A
        ADD CONSTRAINT UQ_A UNIQUE (KEYA1, KEYA2)
        
;





ALTER TABLE B ADD CONSTRAINT FK_B_BBACK
        FOREIGN KEY (BBACK) REFERENCES A (ID) ON DELETE CASCADE
;


ALTER TABLE A ADD CONSTRAINT FK_A_BCKO
        FOREIGN KEY (BCKO) REFERENCES B (ID)
;



ALTER TABLE BBACKINV_SETBCKOINV ADD CONSTRAINT FK_BBACKINV_SETBCKOINV_SETBC48
        FOREIGN KEY (SETBCKOINV) REFERENCES B (ID)
;
ALTER TABLE BBACKINV_SETBCKOINV ADD CONSTRAINT FK_BBACKINV_SETBCKOINV_BBACK62
        FOREIGN KEY (BBACKINV) REFERENCES A (ID)
;


ALTER TABLE A_SETBCKO ADD CONSTRAINT FK_A_SETBCKO_SETBCKO
        FOREIGN KEY (SETBCKO) REFERENCES B (ID)
;
ALTER TABLE A_SETBCKO ADD CONSTRAINT FK_A_SETBCKO_A
        FOREIGN KEY (A) REFERENCES A (ID)
;

-------------------------------------- MySQL
--------------------------------------
DROP TABLE IF EXISTS BBACKINV_SETBCKOINV;

DROP TABLE IF EXISTS A_SETBCKO;


DROP TABLE IF EXISTS A;

DROP TABLE IF EXISTS B;



CREATE TABLE B (
  ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  KEYB1 VARCHAR(100) NOT NULL,
  KEYB2 VARCHAR(100) NOT NULL,
  CREATEDDATE TIMESTAMP,
  CREATEDBY VARCHAR(50),
  LASTUPDATED TIMESTAMP,
  LASTUPDATEDBY VARCHAR(50),
  VERSION BIGINT NOT NULL,
  BBACK BIGINT NOT NULL,
  FOREIGN KEY (BBACK) REFERENCES A(ID) ON DELETE CASCADE
,
  CONSTRAINT UNIQUE (KEYB1, KEYB2)
);

CREATE TABLE A (
  ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  KEYA1 VARCHAR(100) NOT NULL,
  KEYA2 VARCHAR(100) NOT NULL,
  CREATEDDATE TIMESTAMP,
  CREATEDBY VARCHAR(50),
  LASTUPDATED TIMESTAMP,
  LASTUPDATEDBY VARCHAR(50),
  VERSION BIGINT NOT NULL,
  BCKO BIGINT NOT NULL,
  FOREIGN KEY (BCKO) REFERENCES B(ID)
,
  CONSTRAINT UNIQUE (KEYA1, KEYA2)
);



CREATE TABLE A_SETBCKO (
  SETBCKO BIGINT NOT NULL,
  FOREIGN KEY (SETBCKO) REFERENCES B(ID),
  A BIGINT NOT NULL,
  FOREIGN KEY (A) REFERENCES A(ID)
);

CREATE TABLE BBACKINV_SETBCKOINV (
  SETBCKOINV BIGINT NOT NULL,
  FOREIGN KEY (SETBCKOINV) REFERENCES B(ID),
  BBACKINV BIGINT NOT NULL,
  FOREIGN KEY (BBACKINV) REFERENCES A(ID)
);


On Fri, Nov 28, 2008 at 8:52 PM, Patrik Nordwall
<[EMAIL PROTECTED]> wrote:
>
> We need all help we can get. You are welcome to contribute.
>
> Take a look at the issues in the  http://fornax-platform.org/cp/x/KwY
> Roadmap  or in  http://www.fornax-platform.org/tracker/browse/CSC Jira  and
> you will probably find something suitable.
>
> One thing that would be good if you can do, and I think it is a good
> starter:
> http://www.fornax-platform.org/tracker/browse/CSC-213 CSC-213  Add foreign
> keys afterwards in MySQL DDL.
>
> You can send me patches and I will review and commit. If you do bigger tasks
> you will become a member of Fornax and will have permission to commit
> directly to Subversion.
>
> /Patrik
>
>
> PaloT wrote:
>>
>> Hello Patrik,
>> thanks for all your hard (and for me also exciting) work. Could I (we)
>> somehow
>> help you?
>> I can't find some rules how to get involved into project. It will be
>> nice to have one
>> page where you can describe how we should fix bugs, where to send patches,
>> simply how to get on board.
>> I personally should invest some time to this project however for now I
>> don't know
>> how to choose work. Of course this stuff around oAW is complex and I'm
>> sure
>> it will take me more time to fix something, but from what I know people
>> working
>> around MDSD are usually clever and lazy what's are very good conditions to
>> be very productive.
>>
>> TNX
>>
>> Pavel
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/-sculptor--1.5.0-Roadmap-tp20723361s17564p20739766.html
> Sent from the Fornax-Platform mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Fornax-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to