两张表user和message,通过message的owner列外键一对多双向关联,配置如下,通过hibernate的hbm2ddl.auto自动create建表语句,怎么会有两个外键关联,一个是owner,一个是id列?不懂啊。。。
create table MESSAGE (ID integer not null auto_increment, OWNER integer, MSG varchar(255), GENDATE datetime, idx integer, primary key (ID))
03:44:19,580 DEBUG SchemaExport:415 - create table USER (ID integer not null auto_increment, NAME varchar(255), PASSWORD varchar(255), GENDATE datetime, primary key (ID))
[color=red]
03:44:19,661 DEBUG SchemaExport:415 - alter table MESSAGE add index FK63B68BE7829B6014 (ID), add constraint FK63B68BE7829B6014 foreign key (ID) references USER (ID)
03:44:19,939 DEBUG SchemaExport:415 - alter table MESSAGE add index FK63B68BE788EF45AC (OWNER), add constraint FK63B68BE788EF45AC foreign key (OWNER) references USER (ID)
[/color]
[code="xml"]
[/code]