Search in sources :

Example 1 with KeyedSqmFunctionDescriptors

use of org.hibernate.spatial.KeyedSqmFunctionDescriptors in project hibernate-orm by hibernate.

the class H2GisDialectContributor method contributeFunctions.

@Override
public void contributeFunctions(FunctionContributions functionContributions) {
    HSMessageLogger.LOGGER.functionContributions(this.getClass().getCanonicalName());
    final KeyedSqmFunctionDescriptors functions = new H2SqmFunctionDescriptors(functionContributions);
    final SqmFunctionRegistry functionRegistry = functionContributions.getFunctionRegistry();
    functions.asMap().forEach((key, desc) -> {
        functionRegistry.register(key.getName(), desc);
        key.getAltName().ifPresent(altName -> functionRegistry.registerAlternateKey(altName, key.getName()));
    });
}
Also used : KeyedSqmFunctionDescriptors(org.hibernate.spatial.KeyedSqmFunctionDescriptors) SqmFunctionRegistry(org.hibernate.query.sqm.function.SqmFunctionRegistry)

Example 2 with KeyedSqmFunctionDescriptors

use of org.hibernate.spatial.KeyedSqmFunctionDescriptors in project hibernate-orm by hibernate.

the class MariaDBDialectContributor method contributeFunctions.

@Override
public void contributeFunctions(FunctionContributions functionContributions) {
    HSMessageLogger.LOGGER.functionContributions(this.getClass().getCanonicalName());
    final KeyedSqmFunctionDescriptors mariaDbFunctions = new MariaDBSqmFunctionDescriptors(functionContributions);
    final SqmFunctionRegistry functionRegistry = functionContributions.getFunctionRegistry();
    mariaDbFunctions.asMap().forEach((key, desc) -> {
        functionRegistry.register(key.getName(), desc);
        key.getAltName().ifPresent(altName -> functionRegistry.registerAlternateKey(altName, key.getName()));
    });
}
Also used : KeyedSqmFunctionDescriptors(org.hibernate.spatial.KeyedSqmFunctionDescriptors) SqmFunctionRegistry(org.hibernate.query.sqm.function.SqmFunctionRegistry)

Example 3 with KeyedSqmFunctionDescriptors

use of org.hibernate.spatial.KeyedSqmFunctionDescriptors in project hibernate-orm by hibernate.

the class MySQLDialectContributor method contributeFunctions.

@Override
public void contributeFunctions(FunctionContributions functionContributions) {
    HSMessageLogger.LOGGER.functionContributions(this.getClass().getCanonicalName());
    final KeyedSqmFunctionDescriptors mysqlFunctions = new MySqlSqmFunctionDescriptors(functionContributions);
    final SqmFunctionRegistry functionRegistry = functionContributions.getFunctionRegistry();
    mysqlFunctions.asMap().forEach((key, desc) -> {
        functionRegistry.register(key.getName(), desc);
        key.getAltName().ifPresent(altName -> functionRegistry.registerAlternateKey(altName, key.getName()));
    });
}
Also used : KeyedSqmFunctionDescriptors(org.hibernate.spatial.KeyedSqmFunctionDescriptors) SqmFunctionRegistry(org.hibernate.query.sqm.function.SqmFunctionRegistry)

Example 4 with KeyedSqmFunctionDescriptors

use of org.hibernate.spatial.KeyedSqmFunctionDescriptors in project hibernate-orm by hibernate.

the class OracleDialectContributor method contributeFunctions.

@Override
public void contributeFunctions(FunctionContributions functionContributions) {
    HSMessageLogger.LOGGER.functionContributions(this.getClass().getCanonicalName());
    KeyedSqmFunctionDescriptors functionDescriptors;
    if (useSTGeometry) {
        functionDescriptors = new OracleSQLMMFunctionDescriptors(functionContributions);
    } else {
        functionDescriptors = new OracleSDOFunctionDescriptors(functionContributions);
    }
    SqmFunctionRegistry functionRegistry = functionContributions.getFunctionRegistry();
    functionDescriptors.asMap().forEach((key, funcDescr) -> {
        functionRegistry.register(key.getName(), funcDescr);
        key.getAltName().ifPresent(altName -> functionRegistry.register(altName, funcDescr));
    });
}
Also used : KeyedSqmFunctionDescriptors(org.hibernate.spatial.KeyedSqmFunctionDescriptors) SqmFunctionRegistry(org.hibernate.query.sqm.function.SqmFunctionRegistry)

Aggregations

SqmFunctionRegistry (org.hibernate.query.sqm.function.SqmFunctionRegistry)4 KeyedSqmFunctionDescriptors (org.hibernate.spatial.KeyedSqmFunctionDescriptors)4