RE: Cayenne Newbe Question

From: JR Ruggentaler (j..pv.com)
Date: Mon Aug 05 2002 - 11:26:18 EDT

  • Next message: Andrus: "PK Generation [Was: Cayenne Newbe Question]"

    Oops for got the script:

    CREATE DATABASE SWStaging;

    USE SWStaging;

    CREATE TABLE CLAIM (CLAIM_ID INT NOT NULL, INVOICE DECIMAL(12) NULL,
    DATABASE VARCHAR(2) NULL, PROVIDER_ID INT NULL, DOS DATE NULL, PATIENT_ID
    INT NULL, DIAGNOSIS4 VARCHAR(8) NULL, DIAGNOSIS3 VARCHAR(8) NULL, DIAGNOSIS2
    VARCHAR(8) NULL, DIAGNOSIS1 VARCHAR(8) NULL, PRIMARY KEY (CLAIM_ID));

    CREATE TABLE LINE_ITEM (UNITS DECIMAL(4) NULL, CLAIM_ID INT NULL, MODIFIER3
    VARCHAR(2) NULL, LINE_ITME_ID INT NOT NULL, MODIFIER2 VARCHAR(2) NULL,
    MODIFIER1 VARCHAR(2) NULL, DIAGNOSIS_CODE4 VARCHAR(1) NULL, PROCEDURE_CODE
    VARCHAR(5) NULL, STARTING_DOS DATE NULL, DIAGNOSIS_CODE3 VARCHAR(1) NULL,
    NPI VARCHAR(10) NULL, DIAGNOSIS_CODE1 VARCHAR(1) NULL, PLACE_OF_SERVICE
    VARCHAR(5) NULL, CHARGE DECIMAL(10) NULL, TYPE_OF_SERVICE VARCHAR(5) NULL,
    ENDING_DOS DATE NULL, PRIMARY KEY (LINE_ITME_ID));

    CREATE TABLE AUTO_PK_SUPPORT ( TABLE_NAME CHAR(100) NOT NULL, NEXT_ID
    INTEGER NOT NULL);

    INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('CLAIM', 200);

    INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('LINE_ITEM', 200);

    J.R.

    -----Original Message-----
    From: Andrus [mailto:andru..bjectstyle.org]
    Sent: Monday, August 05, 2002 5:14 AM
    To: JR Ruggentaler
    Cc: cayenne-use..bjectstyle.org
    Subject: RE: Cayenne Newbe Question

    Hopefully this one should be easy to fix. Basically you need a lookup table
    for the primary keys in the database. Instructions how to generate it from
    the modeler are given in the User Guide at
    http://objectstyle.org/cayenne/userguide/modeler/pksupport.html

    Andrus

    At 11:21 PM 8/4/2002 -0500, JR Ruggentaler wrote:
    >Andrus,
    > thanks! the initialization problem seem to have been due to the
    JAXP
    >Version 1.0.1 library I had in my jre/lib/ext directory. I removed JAXP
    >1.0.1 but now I seem to have a problem with generating PKs. My test tries
    to
    >create a Claim object but Cayenne throws an exception in
    >ctxt.commitChanges(java.util.logging.Level.SEVERE);.



    This archive was generated by hypermail 2.0.0 : Mon Aug 05 2002 - 11:26:01 EDT