Skip to content

Commit

Permalink
PostgreSQLEnumType error "Could not set value of type" with Hibernate…
Browse files Browse the repository at this point in the history
… 6 and Quarkus Panache #634
  • Loading branch information
vladmihalcea committed Jun 12, 2023
1 parent b5ba7e7 commit d58f07e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import java.lang.reflect.*;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* <code>ReflectionUtils</code> - Reflection utilities holder.
Expand All @@ -18,8 +16,6 @@ public final class ReflectionUtils {

private static final String SETTER_PREFIX = "set";

private static final Map<String, Class> CLASS_MAP = new ConcurrentHashMap<String, Class>();

/**
* Prevent any instantiation.
*/
Expand Down Expand Up @@ -503,12 +499,7 @@ public static <T> T invokeStaticMethod(Method method, Object... parameters) {
@SuppressWarnings("unchecked")
public static <T> Class<T> getClass(String className) {
try {
Class<T> clazz = CLASS_MAP.get(className);
if(clazz == null) {
clazz = (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
CLASS_MAP.put(className, clazz);
}
return clazz;
return (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw handleException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import java.lang.reflect.*;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* <code>ReflectionUtils</code> - Reflection utilities holder.
Expand All @@ -18,8 +16,6 @@ public final class ReflectionUtils {

private static final String SETTER_PREFIX = "set";

private static final Map<String, Class> CLASS_MAP = new ConcurrentHashMap<String, Class>();

/**
* Prevent any instantiation.
*/
Expand Down Expand Up @@ -503,12 +499,7 @@ public static <T> T invokeStaticMethod(Method method, Object... parameters) {
@SuppressWarnings("unchecked")
public static <T> Class<T> getClass(String className) {
try {
Class<T> clazz = CLASS_MAP.get(className);
if(clazz == null) {
clazz = (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
CLASS_MAP.put(className, clazz);
}
return clazz;
return (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw handleException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import java.lang.reflect.*;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* <code>ReflectionUtils</code> - Reflection utilities holder.
Expand All @@ -18,8 +16,6 @@ public final class ReflectionUtils {

private static final String SETTER_PREFIX = "set";

private static final Map<String, Class> CLASS_MAP = new ConcurrentHashMap<>();

/**
* Prevent any instantiation.
*/
Expand Down Expand Up @@ -503,12 +499,7 @@ public static <T> T invokeStaticMethod(Method method, Object... parameters) {
@SuppressWarnings("unchecked")
public static <T> Class<T> getClass(String className) {
try {
Class<T> clazz = CLASS_MAP.get(className);
if(clazz == null) {
clazz = (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
CLASS_MAP.put(className, clazz);
}
return clazz;
return (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw handleException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import java.lang.reflect.*;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* <code>ReflectionUtils</code> - Reflection utilities holder.
Expand All @@ -18,8 +16,6 @@ public final class ReflectionUtils {

private static final String SETTER_PREFIX = "set";

private static final Map<String, Class> CLASS_MAP = new ConcurrentHashMap<>();

/**
* Prevent any instantiation.
*/
Expand Down Expand Up @@ -503,12 +499,7 @@ public static <T> T invokeStaticMethod(Method method, Object... parameters) {
@SuppressWarnings("unchecked")
public static <T> Class<T> getClass(String className) {
try {
Class<T> clazz = CLASS_MAP.get(className);
if(clazz == null) {
clazz = (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
CLASS_MAP.put(className, clazz);
}
return clazz;
return (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw handleException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

import java.lang.reflect.*;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* <code>ReflectionUtils</code> - Reflection utilities holder.
Expand All @@ -18,8 +16,6 @@ public final class ReflectionUtils {

private static final String SETTER_PREFIX = "set";

private static final Map<String, Class> CLASS_MAP = new ConcurrentHashMap<>();

/**
* Prevent any instantiation.
*/
Expand Down Expand Up @@ -503,12 +499,7 @@ public static <T> T invokeStaticMethod(Method method, Object... parameters) {
@SuppressWarnings("unchecked")
public static <T> Class<T> getClass(String className) {
try {
Class<T> clazz = CLASS_MAP.get(className);
if(clazz == null) {
clazz = (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
CLASS_MAP.put(className, clazz);
}
return clazz;
return (Class<T>) Class.forName(className, false, Thread.currentThread().getContextClassLoader());
} catch (ClassNotFoundException e) {
throw handleException(e);
}
Expand Down

0 comments on commit d58f07e

Please sign in to comment.