Package com.blazebit.persistence.spi
Class JpqlFunctionGroup
java.lang.Object
com.blazebit.persistence.spi.JpqlFunctionGroup
public final class JpqlFunctionGroup extends Object
A group of
JpqlFunction
s for various DBMSes under a single function name.- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Constructor Summary
Constructors Constructor Description JpqlFunctionGroup(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 Type Method Description void
add(String rdbms, JpqlFunction function)
Adds the givenJpqlFunction
for the given RDBMS to the group.boolean
contains(String rdbms)
Whether aJpqlFunction
for the given RDBMS name exists.JpqlFunction
get(String rdbms)
Returns theJpqlFunction
for the given RDBMS name.JpqlFunctionKind
getKind()
Returns the function kind.String
getName()
The name of the function.JpqlFunctionProcessor<?>
getProcessor(String rdbms)
Returns theJpqlFunctionProcessor
for the given RDBMS name for this function.boolean
isAggregate()
Whether 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 theJpqlFunction
for the given RDBMS name.- Parameters:
rdbms
- The RDBMS name- Returns:
- The
JpqlFunction
or null
-
getProcessor
Returns theJpqlFunctionProcessor
for the given RDBMS name for this function.- Parameters:
rdbms
- The RDBMS name- Returns:
- The
JpqlFunctionProcessor
or null - Since:
- 1.5.0
-
contains
Whether aJpqlFunction
for 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 givenJpqlFunction
for the given RDBMS to the group.- Parameters:
rdbms
- The RDBMS name for which to register the function or null to register the default functionfunction
- TheJpqlFunction
to register
-