Package org.hibernate

Class Hibernate.CollectionInterface<C>

  • Type Parameters:
    C - the type of collection, for example, List&lt;User&gt;
    Enclosing class:
    Hibernate

    public static final class Hibernate.CollectionInterface<C>
    extends Object
    Operations for obtaining references to persistent collections of a certain type.
    Since:
    6.0
    • Method Detail

      • createDetachedInstance

        public C createDetachedInstance()
        Obtain a detached, uninitialized persistent collection of the type represented by this object.

        The returned wrapper object is not associated with any session, and cannot be initialized by calling Hibernate.initialize(Object). It can be used to represent an uninitialized collection when working with a detached object graph.

        Returns:
        an uninitialized persistent collection
      • createNewInstance

        public C createNewInstance()
        Instantiate an empty collection of the type represented by this object.
        Returns:
        a newly-instantiated empty collection