Enum ResultColumnReferenceStrategy

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALIAS
      For databases which do not support SOURCE, ANSI SQL defines two allowable approaches.
      ORDINAL
      For databases which do not support SOURCE, ANSI SQL defines two allowable approaches.
      SOURCE
      This strategy says to reference the result columns by the qualified column name found in the result source.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ResultColumnReferenceStrategy resolveByName​(java.lang.String name)
      Resolves the strategy by name, in a case insensitive manner.
      static ResultColumnReferenceStrategy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ResultColumnReferenceStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • 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 ANSI 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 ANSI SQL compliant approach is ALIAS.

    • Method Detail

      • values

        public static ResultColumnReferenceStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ResultColumnReferenceStrategy c : ResultColumnReferenceStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ResultColumnReferenceStrategy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • resolveByName

        public static ResultColumnReferenceStrategy resolveByName​(java.lang.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