diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProvider.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProvider.java index 46af056edd..9ebdcd03bc 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProvider.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProvider.java @@ -23,18 +23,18 @@ import org.keycloak.models.cache.infinispan.entities.InRealm; public class CachedIdentityProvider extends AbstractRevisioned implements InRealm { - private final RealmModel realm; + private final String realm; private final IdentityProviderModel idp; public CachedIdentityProvider(Long revision, RealmModel realm, String cacheKey, IdentityProviderModel idp) { super(revision, cacheKey); - this.realm = realm; + this.realm = realm.getId(); this.idp = idp; } @Override public String getRealm() { - return realm.getId(); + return realm; } public IdentityProviderModel getIdentityProvider() { diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProviderMapper.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProviderMapper.java index 76d2d6a23b..8606940540 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProviderMapper.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/idp/CachedIdentityProviderMapper.java @@ -23,18 +23,18 @@ import org.keycloak.models.cache.infinispan.entities.InRealm; public class CachedIdentityProviderMapper extends AbstractRevisioned implements InRealm { - private final RealmModel realm; + private final String realm; private final IdentityProviderMapperModel mapper; public CachedIdentityProviderMapper(Long revision, RealmModel realm, String cacheKey, IdentityProviderMapperModel mapper) { super(revision, cacheKey); - this.realm = realm; + this.realm = realm.getId(); this.mapper = mapper; } @Override public String getRealm() { - return realm.getId(); + return realm; } public IdentityProviderMapperModel getIdentityProviderMapper() { diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/CachedOrganization.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/CachedOrganization.java index b677110486..4a59326b69 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/CachedOrganization.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/CachedOrganization.java @@ -32,7 +32,7 @@ import org.keycloak.models.cache.infinispan.entities.InRealm; public class CachedOrganization extends AbstractRevisioned implements InRealm { - private final RealmModel realm; + private final String realm; private final String name; private final String alias; private final String description; @@ -43,7 +43,7 @@ public class CachedOrganization extends AbstractRevisioned implements InRealm { public CachedOrganization(Long revision, RealmModel realm, OrganizationModel organization) { super(revision, organization.getId()); - this.realm = realm; + this.realm = realm.getId(); this.name = organization.getName(); this.alias = organization.getAlias(); this.description = organization.getDescription(); @@ -55,10 +55,6 @@ public class CachedOrganization extends AbstractRevisioned implements InRealm { @Override public String getRealm() { - return realm.getId(); - } - - public RealmModel getRealmModel() { return realm; }