@Deprecated(since="6.2") public enum LazyToOneOption extends Enum<LazyToOneOption>Deprecated.since
LazyToOneis deprecated, use
FetchTypeinsteadEnumerates the options for lazy loading of a many to one or one to one association.
- See Also:
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description
valueOf(String name)Deprecated.Returns the enum constant of this type with the specified name.
values()Deprecated.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
Enum Constant Detail
@Deprecated public static final LazyToOneOption FALSEDeprecated.use
FetchType.EAGERThe association is always loaded eagerly. The identifier and concrete type of the associated entity instance, along with all the rest of its non-lazy fields, are always available immediately.
@Deprecated public static final LazyToOneOption PROXYDeprecated.use
FetchType.LAZYThe association is proxied and a delegate entity instance is lazily fetched when any method of the proxy other than the getter method for the identifier property is first called.
- The identifier property of the proxy object is set when the proxy is instantiated. The program may obtain the entity identifier value of an unfetched proxy, without triggering lazy fetching, by calling the corresponding getter method.
- The proxy does not have the same concrete type as the
proxied delegate, and so
Hibernate.getClass(Object)must be used in place of
Object.getClass(), and this method fetches the entity by side-effect.
- For a polymorphic association, the concrete type of
the proxied entity instance is not known until the
delegate is fetched from the database, and so
Hibernate.unproxy(Object, Class)} must be used to perform typecasts, and
Hibernate.getClass(Object)must be used instead of the Java
@Deprecated public static final LazyToOneOption NO_PROXYDeprecated.this setting no longer has any useful effectThe associated entity instance is initially in an unloaded state, and is loaded lazily when any field other than the field containing the identifier is first accessed.
- The identifier field of an unloaded entity instance is set when the unloaded instance is instantiated. The program may obtain the identifier of an unloaded entity, without triggering lazy fetching, by accessing the field containing the identifier.
- Typecasts, the Java
Object.getClass()may be used as normal.
- Bytecode enhancement is required. If the class is not
enhanced, this option is equivalent to
Hibernate does not support this setting for polymorphic associations, and instead falls back to
public static LazyToOneOption values()Deprecated.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 (LazyToOneOption c : LazyToOneOption.values()) System.out.println(c);
- an array containing the constants of this enum type, in the order they are declared
public static LazyToOneOption valueOf(String name)Deprecated.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.)