in

The ORM Foundation

Get the facts!

Odd Bug?

Last post Thu, Sep 17 2009 7:20 by NGoodwin. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • Wed, Sep 16 2009 13:39

    • NGoodwin
    • Top 200 Contributor
    • Joined on Wed, Sep 16 2009
    • Posts 2

    Odd Bug?

    I have noticed that when nORMa generates the DDL for a super simple setup for mysql (or postgres or mssql)

    and the mysql sql ddl is generated as:

    CREATE TABLE Person
    (
        SSN CHAR(12) NOT NULL,
        CONSTRAINT Person_PK PRIMARY KEY(SSN)
    );

    CREATE TABLE Company
    (
        companyId INT AUTO_INCREMENT NOT NULL,
        CName VARCHAR(16383) NOT NULL,
        CONSTRAINT Company_PK PRIMARY KEY(companyId),
        CONSTRAINT Company_UC UNIQUE(CName)
    );

    CREATE TABLE Employment
    (
        person CHAR(12) NOT NULL,
        companyId INT NOT NULL,
        CONSTRAINT Employment_PK PRIMARY KEY(person, companyId)
    );

    CREATE TABLE InterestConflict
    (
        person CHAR(12) NOT NULL,
        companyId INT NOT NULL,
        CONSTRAINT InterestConflict_PK PRIMARY KEY(person, companyId)
    );

    ALTER TABLE Employment ADD CONSTRAINT Employment_FK1 FOREIGN KEY (person) REFERENCES Person (SSN) ON DELETE RESTRICT ON UPDATE RESTRICT;
    ALTER TABLE Employment ADD CONSTRAINT Employment_FK2 FOREIGN KEY (companyId) REFERENCES Company (companyId) ON DELETE RESTRICT ON UPDATE RESTRICT;
    ALTER TABLE InterestConflict ADD CONSTRAINT InterestConflict_FK1 FOREIGN KEY (person) REFERENCES Person (SSN) ON DELETE RESTRICT ON UPDATE RESTRICT;
    ALTER TABLE InterestConflict ADD CONSTRAINT InterestConflict_FK2 FOREIGN KEY (companyId) REFERENCES Company (companyId) ON DELETE RESTRICT ON UPDATE RESTRICT;

     

    Now this would be fine except that the model is super simple:  it is the model from the .doc helpfile that installed with nORMa.  Nothing but person, conflict of interest, company, and Employment objects and an Exclusion constraint.  The exclusion constraint is ignored when creating the DDL.  Just wondering what was up with that.  Thank you.
  • Wed, Sep 16 2009 16:02 In reply to

    Re: Odd Bug?

    SQL generation for external constraints such as exclusion is not yet implemented in the NORMA DDL generation.

    We are currently focusing development on formal entry of derivation rules and joined constraints, which will be followed by a push into the relational models and DDL generation for all of the non-structural constraints and derivation rules that can be expressed in ORM. Terry will work on getting the mappings for different patterns specified, and we will then implement the mappings.

    Thank you for your patience as we work on improving NORMA.

    -Matt 

  • Thu, Sep 17 2009 7:20 In reply to

    • NGoodwin
    • Top 200 Contributor
    • Joined on Wed, Sep 16 2009
    • Posts 2

    Re: Odd Bug?

     Oooh! Okay.  Thanks for clarifying.  nORMa is very well done.  Thanks for the effort and response! :)

Page 1 of 1 (3 items)
© 2008-2024 ------- Terms of Service