From 9251e8bfdc377f9d0ec25dfbe2bbd536a8e66cf6 Mon Sep 17 00:00:00 2001 From: Karel Maesen Date: Wed, 28 Jul 2021 23:18:58 +0200 Subject: [PATCH] HHH-14801 Add ServiceRegistry as a parameter to the SqmFunctionDescriptors constructor --- .../spatial/dialect/postgis/PostgisDialectContributor.java | 2 +- .../dialect/postgis/PostgisSqmFunctionDescriptors.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisDialectContributor.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisDialectContributor.java index 177f3cbd26..274db91404 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisDialectContributor.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisDialectContributor.java @@ -38,7 +38,7 @@ public class PostgisDialectContributor implements ContributorImplementor { @Override public void contributeFunctions(FunctionContributions functionContributions) { HSMessageLogger.LOGGER.functionContributions( this.getClass().getCanonicalName() ); - PostgisSqmFunctionDescriptors postgisFunctions = new PostgisSqmFunctionDescriptors(); + PostgisSqmFunctionDescriptors postgisFunctions = new PostgisSqmFunctionDescriptors( getServiceRegistry() ); postgisFunctions.asMap().forEach( (key, desc) -> { functionContributions.contributeFunction( key.getName(), desc ); diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSqmFunctionDescriptors.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSqmFunctionDescriptors.java index 4011d168ea..17c27d927c 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSqmFunctionDescriptors.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSqmFunctionDescriptors.java @@ -16,6 +16,7 @@ import org.hibernate.query.sqm.function.NamedSqmFunctionDescriptor; import org.hibernate.query.sqm.function.SqmFunctionDescriptor; import org.hibernate.query.sqm.produce.function.StandardArgumentsValidators; import org.hibernate.query.sqm.produce.function.StandardFunctionReturnTypeResolvers; +import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.KeyedSqmFunctionDescriptors; import org.hibernate.spatial.FunctionKey; @@ -25,7 +26,8 @@ public class PostgisSqmFunctionDescriptors implements KeyedSqmFunctionDescriptor private final Map map = new HashMap<>(); - PostgisSqmFunctionDescriptors() { + PostgisSqmFunctionDescriptors(ServiceRegistry serviceRegistry) { + map.put( ST_GEOMETRYTYPE.getKey(), new NamedSqmFunctionDescriptor( ST_GEOMETRYTYPE.getKey().getName(),