From f345c8b931c0dcef15ab067d865723a0c4016442 Mon Sep 17 00:00:00 2001 From: Alexander Schwartz Date: Fri, 31 Mar 2023 10:56:22 +0200 Subject: [PATCH] Revert "Fix problem when Hibernate on MySQL is confused to read back Enums from VARCHARs" This doesn't work with Hibernate 6.2.0.Final any more, and it is no longer needed after changing the VARCHAR to TINYINT for the enums This reverts commit 0d96b8db6b9f8cefc2997d350cc6359c01cd61be. --- .../org/keycloak/authorization/jpa/entities/PolicyEntity.java | 4 ---- .../authorization/jpa/entities/ResourceServerEntity.java | 3 --- 2 files changed, 7 deletions(-) diff --git a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/PolicyEntity.java b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/PolicyEntity.java index 53dab5ff61..d7c5d252c5 100644 --- a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/PolicyEntity.java +++ b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/PolicyEntity.java @@ -41,9 +41,7 @@ import jakarta.persistence.UniqueConstraint; import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; -import org.hibernate.annotations.JdbcType; import org.hibernate.annotations.Nationalized; -import org.hibernate.type.descriptor.jdbc.VarcharJdbcType; import org.keycloak.representations.idm.authorization.DecisionStrategy; import org.keycloak.representations.idm.authorization.Logic; @@ -88,11 +86,9 @@ public class PolicyEntity { private String type; @Column(name = "DECISION_STRATEGY") - @JdbcType(VarcharJdbcType.class) private DecisionStrategy decisionStrategy = DecisionStrategy.UNANIMOUS; @Column(name = "LOGIC") - @JdbcType(VarcharJdbcType.class) private Logic logic = Logic.POSITIVE; @ElementCollection(fetch = FetchType.LAZY) diff --git a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceServerEntity.java b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceServerEntity.java index 7c4cde6769..ed92c62ad2 100644 --- a/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceServerEntity.java +++ b/model/jpa/src/main/java/org/keycloak/authorization/jpa/entities/ResourceServerEntity.java @@ -18,8 +18,6 @@ package org.keycloak.authorization.jpa.entities; -import org.hibernate.annotations.JdbcType; -import org.hibernate.type.descriptor.jdbc.VarcharJdbcType; import org.keycloak.representations.idm.authorization.DecisionStrategy; import org.keycloak.representations.idm.authorization.PolicyEnforcementMode; @@ -43,7 +41,6 @@ public class ResourceServerEntity { private boolean allowRemoteResourceManagement; @Column(name = "POLICY_ENFORCE_MODE") - @JdbcType(VarcharJdbcType.class) private PolicyEnforcementMode policyEnforcementMode = PolicyEnforcementMode.ENFORCING; @Column(name = "DECISION_STRATEGY")