drop table if exists "A" ;
create table if not exists "A" (
id serial primary key ,
AText text
);
drop table if exists "B" ;
create table if not exists "B" (
id serial primary key ,
BText text
);
create table if not exists "ABS" (
"A_Id" char(32) not null REFERENCES "A"("id"),
"B_Id" char(32) not null REFERENCES "B"("id"),
primary key ("A_Id", "B_Id")
);
create table if not exists "ASBS" (
"A_Id" char(32) not null REFERENCES "A"("id"),
"B_Id" char(32) not null REFERENCES "B"("id"),
primary key ("A_Id", "B_Id")
);
假设有表A和表B,ABS 是一对多关系 ASBS是多对多关系。 我想知道MYBATIS 中如何处理curd以及 联合主键如何处理
和你普通的单表crud一样,业务交给代码去处理,别啥都给到sql和orm框架去做