mybatis 下一对多,多对多关系。中间关系表如何处理

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以及 联合主键如何处理

阅读 1.5k
1 个回答

和你普通的单表crud一样,业务交给代码去处理,别啥都给到sql和orm框架去做

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题