Class JpqlFunctionGroup


  • public final class JpqlFunctionGroup
    extends Object
    A group of JpqlFunctions for various DBMSes under a single function name.
    Since:
    1.0.0
    Author:
    Christian Beikov
    • 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 name
        defaultFunction - 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 name
        aggregate - 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 name
        aggregate - True if the function is an aggregate function, false otherwise
        rdbmsFunctions - 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
      • contains

        public boolean contains​(String rdbms)
        Whether a JpqlFunction 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 given JpqlFunction for the given RDBMS to the group.
        Parameters:
        rdbms - The RDBMS name for which to register the function or null to register the default function
        function - The JpqlFunction to register