1 Reply Latest reply on Feb 25, 2010 6:36 PM by Francisco Jose Peredo Noguez

    seam-gen generated model have no relationships

    Vibe ofBoston Newbie

      i have 2 simple tables in mysql one with foreign key reference.
      i did seam generate-model and it created the two classes but without any relationships.
      here are the 2 tables.


      CREATE TABLE USER (
             ID INT(11) NOT NULL AUTO_INCREMENT
           , LASTNAME VARCHAR(45) DEFAULT 'NULL'
           , FIRSTNAME VARCHAR(45) DEFAULT 'NULL'
           , EMAIL VARCHAR(255) DEFAULT 'NULL'
           , TITLE VARCHAR(255) DEFAULT 'NULL'
           , USERNAME VARCHAR(20) NOT NULL
           , PASSWORD VARCHAR(20) NOT NULL
           , CREATEDON DATETIME NOT NULL
           , LASTUPDATEDON DATETIME NOT NULL
           , NOTE TEXT
           , ACTIVE TINYINT DEFAULT 0
           , PRIMARY KEY (ID)
      )
      ENGINE = InnoDB
      DEFAULT CHARACTER SET = utf8;
      
      CREATE TABLE NIYANTRENDB.TICKETHISTORY (
             ID INT(11) NOT NULL AUTO_INCREMENT
           , FIELD CHAR(25) NOT NULL
           , CHANGEDESCRIPTION VARCHAR(2000)
           , OLDVALUE VARCHAR(255)
           , NEWVALUE VARCHAR(255)
           , USERID INT(11) NOT NULL
           , TICKETID INT(11) NOT NULL
           , ACTIVITYTIME DATETIME NOT NULL
           , PRIMARY KEY (ID)
           , INDEX (USERID)
           , CONSTRAINT FK_TICKETHISTORY_1 FOREIGN KEY (USERID)
                        REFERENCES NIYANTRENDB.USER (ID)
           , INDEX (TICKETID)
           , CONSTRAINT FK_TICKETHISTORY_2 FOREIGN KEY (TICKETID)
                        REFERENCES NIYANTRENDB.TICKET (ID)
           ON DELETE NO ACTION
          ON UPDATE NO ACTION
      )
      ENGINE = InnoDB
      DEFAULT CHARACTER SET = utf8;




      The class TicketHistory simply has

      userid

      and
      ticketid

      as primtive fields. i was expecting an object with one-to-one relationship.
      can someone please highlight why would seam-gen generate-model not create these relationships.