public class

BagType

extends CollectionType
java.lang.Object
   ↳ org.hibernate.type.AbstractType
     ↳ org.hibernate.type.CollectionType
       ↳ org.hibernate.type.BagType

Summary

[Expand]
Inherited Fields
From class org.hibernate.type.CollectionType
Public Constructors
BagType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML)
Public Methods
Class getReturnedClass()
Object instantiate(int anticipatedSize)
Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e.
PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
Instantiate an uninitialized collection wrapper or holder.
PersistentCollection wrap(SessionImplementor session, Object collection)
Wrap the naked collection instance in a wrapper, or instantiate a holder.
[Expand]
Inherited Methods
From class org.hibernate.type.CollectionType
From class org.hibernate.type.AbstractType
From class java.lang.Object
From interface org.hibernate.type.AssociationType
From interface org.hibernate.type.Type

Public Constructors

public BagType (TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML)

Public Methods

public Class getReturnedClass ()

public Object instantiate (int anticipatedSize)

Instantiate an empty instance of the "underlying" collection (not a wrapper), but with the given anticipated size (i.e. accounting for initial capacity and perhaps load factor).

Parameters
anticipatedSize The anticipated size of the instaniated collection after we are done populating it.
Returns
  • A newly instantiated collection to be wrapped.

public PersistentCollection instantiate (SessionImplementor session, CollectionPersister persister, Serializable key)

Instantiate an uninitialized collection wrapper or holder. Callers MUST add the holder to the persistence context!

Parameters
session The session from which the request is originating.
persister The underlying collection persister (metadata)
key The owner key.
Returns
  • The instantiated collection.

public PersistentCollection wrap (SessionImplementor session, Object collection)

Wrap the naked collection instance in a wrapper, or instantiate a holder. Callers MUST add the holder to the persistence context!

Parameters
session The session from which the request is originating.
collection The bare collection to be wrapped.
Returns
  • The wrapped collection.