Enum Class GraphSemantic

java.lang.Object
java.lang.Enum<GraphSemantic>
org.hibernate.graph.GraphSemantic
All Implemented Interfaces:
FindOption, Serializable, Comparable<GraphSemantic>, Constable

public enum GraphSemantic extends Enum<GraphSemantic> implements FindOption
JPA specifies two distinct ways to apply an EntityGraph - as a "fetch graph" or as a "load graph".
  • Enum Constant Details

    • FETCH

      public static final GraphSemantic FETCH
      Indicates that an EntityGraph should be interpreted as a JPA "fetch graph".
      • Attributes explicitly specified using an AttributeNodes are treated as FetchType.EAGER and fetched via a join or subsequent select.
      • Attributes not explicitly specified are treated as FetchType.LAZY and are not fetched.
    • LOAD

      public static final GraphSemantic LOAD
      Indicates that an EntityGraph should be interpreted as a JPA "load graph".
      • Attributes explicitly specified using an AttributeNodes are treated as FetchType.EAGER and fetched via a join or subsequent select.
      • Attributes not explicitly specified are treated as FetchType.LAZY or FetchType.EAGER depending on the mapping of the attribute, instead of forcing FetchType.LAZY.
  • Method Details

    • values

      public static GraphSemantic[] 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 GraphSemantic 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
    • getJakartaHintName

      public String getJakartaHintName()
      The corresponding Jakarta Persistence hint name.
      See Also:
    • fromHintName

      public static GraphSemantic fromHintName(String hintName)