現有表設計如下 如何生成hibernate的配置檔案???

vigour發表於2003-08-21
CREATE TABLE roles(
role_id INT NOT NULL,
role_name VARCHAR(50) NOT NULL,
role_descript VARCHAR(200) NOT NULL,
PRIMARY KEY( role_id )
) TYPE=INNODB;

CREATE TABLE rights(
right_id INT NOT NULL,
right_name VARCHAR(50) NOT NULL,
right_descript VARCHAR(200) NOT NULL,
PRIMARY KEY( right_id )
) TYPE=INNODB;

CREATE TABLE rolerights(
roleright_id INT NOT NULL,
role_id_fk INT NOT NULL,
right_id_fk INT NOT NULL,
PRIMARY KEY(roleright_id,role_id_fk,right_id_fk),
INDEX role_ind(role_id_fk),
INDEX right_ind(right_id_fk),
FOREIGN KEY (role_id_fk) REFERENCES persons(role_id),
FOREIGN KEY (right_id_fk) REFERENCES flights(right_id)
) TYPE=INNODB;

我寫了三個javabean對應上面三個表 但感覺不大對勁
用Middlegen-Hibernate-r1生成的*.hbm好像沒看到幾個表的聯絡關係

相關文章