0 Replies Latest reply on May 12, 2009 9:53 PM by donricouga

    SeamGen generate-entities??

    donricouga

      I have seam 2.1.1 and started a blank project with an existing schema running in MySQL.


      after running seam generate-entities, it runs fine but i noticed the entities generated do not properly annotate with table associations? I'm not sure why it does not.


      For Instance, I have the following table in mysql db.


      CREATE  TABLE IF NOT EXISTS 'mcscDB'.'user' (
        'user_id' INT NOT NULL AUTO_INCREMENT ,
        'role_id' INT NOT NULL ,
        'login_name' VARCHAR(45) NOT NULL ,
        'login_password' VARCHAR(45) NOT NULL ,
        'last_pass_change' DATE NULL ,
        'last_update' TIMESTAMP NOT NULL ,
        PRIMARY KEY ('user_id') ,
        INDEX 'fk_user_roles' ('role_id' ASC) ,
        CONSTRAINT 'fk_user_roles'
          FOREIGN KEY ('role_id' )
          REFERENCES 'mcscDB'.'roles' ('role_id' )
          ON DELETE NO ACTION
          ON UPDATE NO ACTION)
      ENGINE = InnoDB;
      



      So one of the Fields should be a reference to the Roles Entity


      private Roles role;



      but instead it simply puts it as an integer like this


      private int roleId;



      Any ideas why this is happening. I don't want to have to manually modify all the entity objects???


      THANKS IN ADVANCE