HHH-14801 Add ServiceRegistry as a parameter to the SqmFunctionDescriptors constructor

This commit is contained in:
Karel Maesen 2021-07-28 23:18:58 +02:00
parent 71b197d362
commit 9251e8bfdc
2 changed files with 4 additions and 2 deletions

View File

@ -38,7 +38,7 @@ public class PostgisDialectContributor implements ContributorImplementor {
@Override @Override
public void contributeFunctions(FunctionContributions functionContributions) { public void contributeFunctions(FunctionContributions functionContributions) {
HSMessageLogger.LOGGER.functionContributions( this.getClass().getCanonicalName() ); HSMessageLogger.LOGGER.functionContributions( this.getClass().getCanonicalName() );
PostgisSqmFunctionDescriptors postgisFunctions = new PostgisSqmFunctionDescriptors(); PostgisSqmFunctionDescriptors postgisFunctions = new PostgisSqmFunctionDescriptors( getServiceRegistry() );
postgisFunctions.asMap().forEach( (key, desc) -> { postgisFunctions.asMap().forEach( (key, desc) -> {
functionContributions.contributeFunction( key.getName(), desc ); functionContributions.contributeFunction( key.getName(), desc );

View File

@ -16,6 +16,7 @@ import org.hibernate.query.sqm.function.NamedSqmFunctionDescriptor;
import org.hibernate.query.sqm.function.SqmFunctionDescriptor; import org.hibernate.query.sqm.function.SqmFunctionDescriptor;
import org.hibernate.query.sqm.produce.function.StandardArgumentsValidators; import org.hibernate.query.sqm.produce.function.StandardArgumentsValidators;
import org.hibernate.query.sqm.produce.function.StandardFunctionReturnTypeResolvers; import org.hibernate.query.sqm.produce.function.StandardFunctionReturnTypeResolvers;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.spatial.KeyedSqmFunctionDescriptors; import org.hibernate.spatial.KeyedSqmFunctionDescriptors;
import org.hibernate.spatial.FunctionKey; import org.hibernate.spatial.FunctionKey;
@ -25,7 +26,8 @@ public class PostgisSqmFunctionDescriptors implements KeyedSqmFunctionDescriptor
private final Map<FunctionKey, SqmFunctionDescriptor> map = new HashMap<>(); private final Map<FunctionKey, SqmFunctionDescriptor> map = new HashMap<>();
PostgisSqmFunctionDescriptors() { PostgisSqmFunctionDescriptors(ServiceRegistry serviceRegistry) {
map.put( map.put(
ST_GEOMETRYTYPE.getKey(), new NamedSqmFunctionDescriptor( ST_GEOMETRYTYPE.getKey(), new NamedSqmFunctionDescriptor(
ST_GEOMETRYTYPE.getKey().getName(), ST_GEOMETRYTYPE.getKey().getName(),