From 7b51d8617d74f1990ad4bd348749fb732741e560 Mon Sep 17 00:00:00 2001 From: vramik Date: Mon, 30 Jan 2023 12:39:21 +0100 Subject: [PATCH] Remove one side of association which is not used. Closes #16693 --- .../jpa/entities/ResourceEntity.java | 16 ---------------- .../authorization/jpa/entities/ScopeEntity.java | 15 --------------- 2 files changed, 31 deletions(-) diff --git a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceEntity.java b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceEntity.java index 994c0fffcb..68ccdc62b7 100644 --- a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceEntity.java +++ b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceEntity.java @@ -108,10 +108,6 @@ public class ResourceEntity { @BatchSize(size = 20) private List scopes; - @ManyToMany(fetch = FetchType.LAZY, cascade = {}) - @JoinTable(name = "RESOURCE_POLICY", joinColumns = @JoinColumn(name = "RESOURCE_ID"), inverseJoinColumns = @JoinColumn(name = "POLICY_ID")) - private List policies; - @OneToMany(cascade = CascadeType.REMOVE, orphanRemoval = true, mappedBy="resource", fetch = FetchType.LAZY) @Fetch(FetchMode.SELECT) @BatchSize(size = 20) @@ -199,18 +195,6 @@ public class ResourceEntity { return ownerManagedAccess; } - public List getPolicies() { - if (policies == null) { - policies = new LinkedList<>(); - } - return this.policies; - } - - - public void setPolicies(List policies) { - this.policies = policies; - } - public Collection getAttributes() { if (attributes == null) { attributes = new LinkedList<>(); diff --git a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ScopeEntity.java b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ScopeEntity.java index 3a2f409828..f690b2586c 100644 --- a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ScopeEntity.java +++ b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ScopeEntity.java @@ -69,10 +69,6 @@ public class ScopeEntity { @JoinColumn(name = "RESOURCE_SERVER_ID") private ResourceServerEntity resourceServer; - @ManyToMany(fetch = FetchType.LAZY, cascade = {}) - @JoinTable(name = "SCOPE_POLICY", joinColumns = @JoinColumn(name = "SCOPE_ID"), inverseJoinColumns = @JoinColumn(name = "POLICY_ID")) - private List policies; - public String getId() { return id; } @@ -113,17 +109,6 @@ public class ScopeEntity { return resourceServer; } - public List getPolicies() { - if (policies == null) { - policies = new LinkedList<>(); - } - return policies; - } - - public void setPolicies(List policies) { - this.policies = policies; - } - public void setResourceServer(final ResourceServerEntity resourceServer) { this.resourceServer = resourceServer; }