Class JpqlFunctionGroup

java.lang.Object
com.blazebit.persistence.spi.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 Details

    • 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
    • JpqlFunctionGroup

      public JpqlFunctionGroup​(String name, JpqlFunctionKind kind)
      Constructs a function group with the given name.
      Parameters:
      name - The function name
      kind - 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 name
      kind - The function kind
      rdbmsFunctions - The RDBMS functions in a map
      Since:
      1.5.0
  • Method Details

    • 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
    • getKind

      public JpqlFunctionKind getKind()
      Returns the function kind.
      Returns:
      The function kind
      Since:
      1.5.0
    • get

      public JpqlFunction get​(String rdbms)
      Returns the JpqlFunction for the given RDBMS name.
      Parameters:
      rdbms - The RDBMS name
      Returns:
      The JpqlFunction or null
    • getProcessor

      public JpqlFunctionProcessor<?> getProcessor​(String rdbms)
      Returns the JpqlFunctionProcessor 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 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