com.holonplatform.datastore.jdbc.composer.expression

## Interface SQLFunction

- All Superinterfaces:
    com.holonplatform.core.Expression

      public interface SQLFunction
      extends com.holonplatform.core.Expression

  `Expression` which represents a SQL function.
  Since:
    5.1.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `com.holonplatform.core.Expression.ExpressionResolverFunction<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression>, com.holonplatform.core.Expression.InvalidExpressionException`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SQLFunction` | `create(Function<List<String>,String> function)` Create a `SQLFunction` using given `function` as serialization logic.
    `static SQLFunction` | `create(String name)` Create a default `SQLFunction`.
    `static SQLFunction` | `create(String name, boolean parenthesesIfNoArguments)` Create a default `SQLFunction`.
    `static SQLFunction` | `extract(String partName)` Create an `EXTRACT` function, which will be serialized this way: `EXTRACT(partName FROM argument)`.
    `String` | `serialize(List<String> arguments)` Serialize the function as SQL.
    `default String` | `serialize(String... arguments)` Serialize the function as SQL.

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Method Detail

    - #### serialize

          String serialize(List<String> arguments)
                    throws com.holonplatform.core.Expression.InvalidExpressionException

      Serialize the function as SQL.
      Parameters:
        `arguments` - Optional function arguments
      Returns:
        Serialized function
      Throws:
        `InvalidExpressionException` - If the function arguments are not valid
        `com.holonplatform.core.Expression.InvalidExpressionException`

    - #### serialize

          default String serialize(String... arguments)

      Serialize the function as SQL.
      Parameters:
        `arguments` - Function arguments
      Returns:
        Serialized function

    - #### create

          static SQLFunction create(Function<List<String>,String> function)

      Create a `SQLFunction` using given `function` as serialization logic.
      Parameters:
        `function` - Callback function (not null)
      Returns:
        A new `SQLFunction` using given `function` for serialization

    - #### create

          static SQLFunction create(String name,
                                    boolean parenthesesIfNoArguments)

      Create a default `SQLFunction`.
      Parameters:
        `name` - Function name (not null)
        `parenthesesIfNoArguments` - Whether parentheses are required if there are no arguments
      Returns:
        A new `SQLFunction` with given name

    - #### create

          static SQLFunction create(String name)

      Create a default `SQLFunction`. With this builder, parentheses are not added if there are no arguments.
      Parameters:
        `name` - Function name (not null)
      Returns:
        A new `SQLFunction` with given name

    - #### extract

          static SQLFunction extract(String partName)

      Create an `EXTRACT` function, which will be serialized this way: `EXTRACT(partName FROM argument)`.
      Parameters:
        `partName` - The EXTRACT function part name
      Returns:
        A new `EXTRACT` `SQLFunction`

Copyright © 2019 The Holon Platform. All rights reserved.