Enum Class SqlAstNodeRenderingMode

java.lang.Object
java.lang.Enum<SqlAstNodeRenderingMode>
org.hibernate.sql.ast.SqlAstNodeRenderingMode
All Implemented Interfaces:
Serializable, Comparable<SqlAstNodeRenderingMode>, Constable

public enum SqlAstNodeRenderingMode extends Enum<SqlAstNodeRenderingMode>
The rendering mode to use for SqlAstNode. Some functions/contexts require the use of literals/expressions rather than parameters like for example the `char` function in Derby which requires the length as literal. Another example is a function that renders a function argument into a subquery select and group by item. It can use INLINE_PARAMETERS so that a database can match such a select item to a group by item. Without this, such queries would result in a query error.
See Also:
  • Enum Constant Details

    • DEFAULT

      public static final SqlAstNodeRenderingMode DEFAULT
      Render node as is.
    • INLINE_PARAMETERS

      public static final SqlAstNodeRenderingMode INLINE_PARAMETERS
      Render parameters as literals. All parameters within the SqlAstNode are rendered as literals.
    • INLINE_ALL_PARAMETERS

      public static final SqlAstNodeRenderingMode INLINE_ALL_PARAMETERS
      Render all nested parameters as literals. All parameters within the SqlAstNode are rendered as literals.
    • NO_PLAIN_PARAMETER

      public static final SqlAstNodeRenderingMode NO_PLAIN_PARAMETER
      Don't render plain parameters. Render it as literal or as expression. If the SqlAstNode to render is a parameter, it will be rendered either as literal or wrapped into a semantically equivalent expression such that it doesn't appear as plain parameter.
    • NO_UNTYPED

      public static final SqlAstNodeRenderingMode NO_UNTYPED
      Don't render untyped expressions e.g. plain parameters or null literals. Render it as literal or as expression. If the SqlAstNode to render is a parameter, it will be rendered either as literal or wrapped into a semantically equivalent expression such that it doesn't appear as plain parameter. null literals will be wrapped in a cast.
    • WRAP_ALL_PARAMETERS

      public static final SqlAstNodeRenderingMode WRAP_ALL_PARAMETERS
      Wrap all nested parameters with a database specific wrapping strategy, defaulting to wrapping via a subquery e.g. (select ?). This is useful for certain databases that don't support parameters directly within certain functions, like Informix.
  • Method Details

    • values

      public static SqlAstNodeRenderingMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SqlAstNodeRenderingMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null