首页 > 代码库 > Hibernate(六):一对多

Hibernate(六):一对多

Hibernate:

create table CUSTOMER (
CUSTOMER_ID integer not null auto_increment,
CUSTOMER_NAME varchar(255),
primary key (CUSTOMER_ID)
) engine=InnoDB
Hibernate:

create table ORDERS (
ORDER_ID integer not null,
ORDER_NAME varchar(255),
CUSTOMER_ID integer,
primary key (ORDER_ID)
) engine=InnoDB
Hibernate:

alter table ORDERS
add constraint FKkdbly1ij6f4kqh378kfne6ilx
foreign key (CUSTOMER_ID)
references CUSTOMER (CUSTOMER_ID)

Hibernate(六):一对多