Package org.hibernate.annotations

Enum LazyToOneOption

    • Enum Constant Detail

      • FALSE

        @Deprecatedpublic static final LazyToOneOption FALSE
        Deprecated.
        The 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.
      • PROXY

        @Deprecatedpublic static final LazyToOneOption PROXY
        Deprecated.
        The 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 soHibernate.getClass(Object) must be used in place ofObject.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 soHibernate.unproxy(Object, Class)} must be used to perform typecasts, andHibernate.getClass(Object) must be used instead of the Javainstanceof operator.
      • NO_PROXY

        @Deprecatedpublic static final LazyToOneOption NO_PROXY
        Deprecated.
        this setting no longer has any useful effect
        The 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 Javainstanceof operator, andObject.getClass() may be used as normal.
        • Bytecode enhancement is required. If the class is not enhanced, this option is equivalent toPROXY.

        Hibernate does not support this setting for polymorphic associations, and instead falls back toPROXY.

    • Method Detail

      • values

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

        public static LazyToOneOption valueOf​(String name)
        Deprecated.
        Returns the enum constant of this type with the specified name.The string must matchexactly an identifier used to declare anenum 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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null