Package com.blazebit.persistence.spi
Class JpqlFunctionGroup
java.lang.Object
com.blazebit.persistence.spi.JpqlFunctionGroup
A group of
JpqlFunctions for various DBMSes under a single function name.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Constructor Summary
ConstructorsConstructorDescriptionJpqlFunctionGroup(String name) Constructs a non-aggregate function group with the given name.JpqlFunctionGroup(String name, boolean aggregate) Constructs a function group with the given name.JpqlFunctionGroup(String name, boolean aggregate, Map<String, JpqlFunction> rdbmsFunctions) Constructs a function group with the given name and given function mappings.JpqlFunctionGroup(String name, JpqlFunction defaultFunction) Constructs a non-aggregate function group with the given name and given default function.JpqlFunctionGroup(String name, JpqlFunctionKind kind) Constructs a function group with the given name.JpqlFunctionGroup(String name, JpqlFunctionKind kind, Map<String, JpqlFunction> rdbmsFunctions) Constructs a function group with the given name and given function mappings. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(String rdbms, JpqlFunction function) Adds the givenJpqlFunctionfor the given RDBMS to the group.booleanWhether aJpqlFunctionfor the given RDBMS name exists.Returns theJpqlFunctionfor the given RDBMS name.getKind()Returns the function kind.getName()The name of the function.getProcessor(String rdbms) Returns theJpqlFunctionProcessorfor the given RDBMS name for this function.booleanWhether the function is an aggregate.
-
Constructor Details
-
JpqlFunctionGroup
Constructs a non-aggregate function group with the given name.- Parameters:
name- The function name
-
JpqlFunctionGroup
Constructs a non-aggregate function group with the given name and given default function.- Parameters:
name- The function namedefaultFunction- The default function to use when no specific function for a DBMS is available
-
JpqlFunctionGroup
Constructs a function group with the given name.- Parameters:
name- The function nameaggregate- True if the function is an aggregate function, false otherwise
-
JpqlFunctionGroup
Constructs a function group with the given name and given function mappings.- Parameters:
name- The function nameaggregate- True if the function is an aggregate function, false otherwiserdbmsFunctions- The RDBMS functions in a map
-
JpqlFunctionGroup
Constructs a function group with the given name.- Parameters:
name- The function namekind- The function kind- Since:
- 1.5.0
-
JpqlFunctionGroup
public JpqlFunctionGroup(String name, JpqlFunctionKind kind, Map<String, JpqlFunction> rdbmsFunctions) Constructs a function group with the given name and given function mappings.- Parameters:
name- The function namekind- The function kindrdbmsFunctions- The RDBMS functions in a map- Since:
- 1.5.0
-
-
Method Details
-
getName
The name of the function.- Returns:
- The function name
-
isAggregate
public boolean isAggregate()Whether the function is an aggregate.- Returns:
- True if this is an aggregate function, false otherwise
-
getKind
Returns the function kind.- Returns:
- The function kind
- Since:
- 1.5.0
-
get
Returns theJpqlFunctionfor the given RDBMS name.- Parameters:
rdbms- The RDBMS name- Returns:
- The
JpqlFunctionor null
-
getProcessor
Returns theJpqlFunctionProcessorfor the given RDBMS name for this function.- Parameters:
rdbms- The RDBMS name- Returns:
- The
JpqlFunctionProcessoror null - Since:
- 1.5.0
-
contains
Whether aJpqlFunctionfor the given RDBMS name exists.- Parameters:
rdbms- The RDBMS name- Returns:
- True if a function for the RDBMS was registered, false otherwise
-
add
Adds the givenJpqlFunctionfor the given RDBMS to the group.- Parameters:
rdbms- The RDBMS name for which to register the function or null to register the default functionfunction- TheJpqlFunctionto register
-