Jakarta Persistence (JPA) Enum

jakarta.persistence.FetchType

java.lang.Object
  java.lang.Enum<jakarta.persistence.FetchType>
    jakarta.persistence.FetchType
Implemented Interfaces:
Constable, Comparable<E>, Serializable

Defines strategies for fetching data from the database.
  • The EAGER strategy is a requirement on the persistence provider runtime that data must be eagerly fetched.
  • The LAZY strategy is a hint to the persistence provider runtime that data should be fetched lazily when it is first accessed. The implementation is permitted to eagerly fetch data for which the LAZY strategy hint has been specified.

Example:

 @Basic(fetch = LAZY)
 protected String getName() { return name; }
See Also:
Since:
Jakarta Persistence (JPA) 1.0

Enum Constants

Data must be eagerly fetched.
Since:
Jakarta Persistence (JPA) 1.0
Data may be lazily fetched.
Since:
Jakarta Persistence (JPA) 1.0

Synthetic Public Static Methods:

values(), valueOf(String)

Additional JDK methods inherited from java.lang.Enum

clone(), compareTo(E), describeConstable(), equals(Object), finalize(), getDeclaringClass(), hashCode(), name(), ordinal(), readObject(ObjectInputStream), readObjectNoData(), toString(), valueOf(Class,String)

Additional JDK methods inherited from java.lang.Object

clone(), equals(Object), finalize(), getClass(), hashCode(), notify(), notifyAll(), toString(), wait(), wait(long), wait(long,int), wait0(long)

Additional JDK methods inherited from java.lang.constant.Constable

describeConstable()

Additional JDK methods inherited from java.lang.Comparable

compareTo(T)