add convenience method to retrieve Dialect from FunctionContributions

because in fairness this is a little hard to find
This commit is contained in:
Gavin 2023-01-17 00:27:41 +01:00 committed by Gavin King
parent a552a73632
commit a986a3806a
1 changed files with 10 additions and 2 deletions

View File

@ -6,6 +6,7 @@
*/
package org.hibernate.boot.model;
import org.hibernate.dialect.Dialect;
import org.hibernate.query.sqm.function.SqmFunctionRegistry;
import org.hibernate.service.Service;
import org.hibernate.service.ServiceRegistry;
@ -28,12 +29,19 @@ public interface FunctionContributions {
SqmFunctionRegistry getFunctionRegistry();
/**
* Access to type information
* Access to type information.
*/
TypeConfiguration getTypeConfiguration();
/**
* Access to {@linkplain Service services}
* Access to {@linkplain Service services}.
*/
ServiceRegistry getServiceRegistry();
/**
* The {@linkplain Dialect SQL Dialect}.
*/
default Dialect getDialect() {
return getTypeConfiguration().getCurrentBaseSqlTypeIndicators().getDialect();
}
}