简体   繁体   中英

Join three tables into a join table

I have three entities with Many-To-Many relationship between all of them User , Project and Task . I want to join the three tables into one table collaborator that contains only the IDs of the three tables.

But I don't understand how can I join them with @JoinTable plus how can I manage the cascade Types.

Any help would be appreciated.Thanks PS: if there's any other idea it's welcome.

You can select from dinamic temp 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM