diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLPGObjectJdbcType.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLPGObjectJdbcType.java index b52be17bc0..20f5747f53 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLPGObjectJdbcType.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQLPGObjectJdbcType.java @@ -52,7 +52,7 @@ public abstract class PostgreSQLPGObjectJdbcType implements JdbcType { valueSetter = ReflectHelper.setterMethodOrNull( pgObjectClass, "value", String.class ); } catch (Exception e) { - LOG.warn( "PostgreSQL JDBC driver classes are inaccessible and thus, certain DDL types like JSONB, JSON, GEOMETRY can not be used!", e ); + LOG.postgreSQLJdbcDriverNotAccessible(); } PG_OBJECT_CONSTRUCTOR = constructor; TYPE_SETTER = typeSetter; diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index 2b65a8c460..d110ca8522 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -1819,4 +1819,9 @@ public interface CoreMessageLogger extends BasicLogger { id = 513) void unableToGenerateReflectionOptimizer(String className, @Cause Throwable cause); + @LogMessage(level = WARN) + @Message(value = "PostgreSQL JDBC driver classes are inaccessible and thus, certain DDL types like JSONB, JSON, GEOMETRY can not be used.", + id = 514) + void postgreSQLJdbcDriverNotAccessible(); + }