Enum Class ResultColumnReferenceStrategy

java.lang.Object
java.lang.Enum<ResultColumnReferenceStrategy>
org.hibernate.dialect.ResultColumnReferenceStrategy
All Implemented Interfaces:
Serializable, Comparable<ResultColumnReferenceStrategy>, Constable

public enum ResultColumnReferenceStrategy extends Enum<ResultColumnReferenceStrategy>
Defines how we need to reference columns in the group-by, having, and order-by clauses.
  • Enum Constant Details

    • SOURCE

      public static final ResultColumnReferenceStrategy SOURCE
      This strategy says to reference the result columns by the qualified column name found in the result source. This strategy is not strictly allowed by ANSI SQL but is Hibernate's legacy behavior and is also the fastest of the strategies; thus it should be used if supported by the underlying database.
    • ALIAS

      public static final ResultColumnReferenceStrategy ALIAS
      For databases which do not support SOURCE, ANSI SQL defines two allowable approaches. One is to reference the result column by the alias it is given in the result source (if it is given an alias). This strategy says to use this approach.

      The other QNSI SQL compliant approach is ORDINAL.

    • ORDINAL

      public static final ResultColumnReferenceStrategy ORDINAL
      For databases which do not support SOURCE, ANSI SQL defines two allowable approaches. One is to reference the result column by the ordinal position at which it appears in the result source. This strategy says to use this approach.

      The other QNSI SQL compliant approach is ALIAS.

  • Method Details

    • values

      public static ResultColumnReferenceStrategy[] 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 ResultColumnReferenceStrategy 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
    • resolveByName

      public static ResultColumnReferenceStrategy resolveByName(String name)
      Resolves the strategy by name, in a case insensitive manner. If the name cannot be resolved, SOURCE is returned as the default.
      Parameters:
      name - The strategy name to resolve
      Returns:
      The resolved strategy