Package com.blazebit.persistence.spi
Class JpqlFunctionGroup
- java.lang.Object
-
- com.blazebit.persistence.spi.JpqlFunctionGroup
-
public final class JpqlFunctionGroup extends Object
A group ofJpqlFunction
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.
-
Method Summary
All Methods Instance Methods Concrete Methods 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.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 Detail
-
JpqlFunctionGroup
public JpqlFunctionGroup(String name)
Constructs a non-aggregate function group with the given name.- Parameters:
name
- The function name
-
JpqlFunctionGroup
public JpqlFunctionGroup(String name, JpqlFunction defaultFunction)
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
public JpqlFunctionGroup(String name, boolean aggregate)
Constructs a function group with the given name.- Parameters:
name
- The function nameaggregate
- True if the function is an aggregate function, false otherwise
-
JpqlFunctionGroup
public JpqlFunctionGroup(String name, boolean aggregate, Map<String,JpqlFunction> rdbmsFunctions)
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
-
-
Method Detail
-
getName
public String 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
-
get
public JpqlFunction get(String rdbms)
Returns theJpqlFunction
for the given RDBMS name.- Parameters:
rdbms
- The RDBMS name- Returns:
- The
JpqlFunction
or null
-
getProcessor
public JpqlFunctionProcessor<?> getProcessor(String rdbms)
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
public boolean contains(String rdbms)
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
public void add(String rdbms, JpqlFunction function)
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
-
-