将三个 table 连接成一个连接 table

Join three tables into a join table

我有三个实体,它们之间都存在多对多关系 UserProjectTask。我想将三个 table 加入一个 table collaborator,它只包含三个 table 的 ID。

但我不明白如何使用 @JoinTable 加入它们以及如何管理级联类型。

任何帮助都是 appreciated.Thanks P.S: 如有其他想法欢迎提出。

您可以 select 从动态温度 table

select * from (
    select user.id, Project.id, Task.id
    inner join Project on user.join_key = Project.join_key
    inner join  Task  on task.join_key = = Project.join_key
) collaborator