From 0f11234bc926712e977cb09ee0d0a5ffc84c5159 Mon Sep 17 00:00:00 2001 From: "A.P.Rajshekhar" Date: Fri, 15 Sep 2023 14:40:48 +0530 Subject: [PATCH] Fixes related to gamedoora/gamedoora-aggregation-proxy#2 (#38) * initial commit * Closes #2: Create aggregation for User profile. --- src/main/java/com/gamedoora/model/dao/Skills.java | 4 ++-- src/main/java/com/gamedoora/model/dto/GdUser.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/gamedoora/model/dto/GdUser.java diff --git a/src/main/java/com/gamedoora/model/dao/Skills.java b/src/main/java/com/gamedoora/model/dao/Skills.java index f783da45..9372765f 100644 --- a/src/main/java/com/gamedoora/model/dao/Skills.java +++ b/src/main/java/com/gamedoora/model/dao/Skills.java @@ -54,8 +54,8 @@ public class Skills extends Audit implements Serializable { @JoinTable(name = "skills_sources", joinColumns = @JoinColumn(name = "skill_id"), inverseJoinColumns = @JoinColumn(name = "source_id")) Set sources; - @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinTable(name = "roles_skills", joinColumns = @JoinColumn(name = "role_id"), inverseJoinColumns = @JoinColumn(name = "skill_id")) + @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "skills") + //@JoinTable(name = "roles_skills", joinColumns = @JoinColumn(name = "role_id"), inverseJoinColumns = @JoinColumn(name = "skill_id")) Set roles; public long getId() { diff --git a/src/main/java/com/gamedoora/model/dto/GdUser.java b/src/main/java/com/gamedoora/model/dto/GdUser.java new file mode 100644 index 00000000..f2ea4c45 --- /dev/null +++ b/src/main/java/com/gamedoora/model/dto/GdUser.java @@ -0,0 +1,14 @@ +package com.gamedoora.model.dto; + +import lombok.*; + +import java.util.List; + + +@EqualsAndHashCode(callSuper = false) +@Builder +public class GdUser { + private List roles; + private List skills; + private UserDTO user; +}