Interface CollectionPersister

All Superinterfaces:
FilterRestrictable, Restrictable, WhereRestrictable
All Known Implementing Classes:
AbstractCollectionPersister, BasicCollectionPersister, OneToManyPersister

@SPI({USE,IMPLEMENT}) public interface CollectionPersister extends Restrictable
A strategy for persisting a mapped collection role. A CollectionPersister orchestrates rendering of SQL statements corresponding to basic lifecycle events, including insert, update, and delete statements, and their execution via JDBC.

Concrete implementations of this interface handle one-to-many and many-to-many association cardinalities, and to a certain extent abstract the details of those mappings from collaborators.

Note that an instance of PersistentCollection may change roles. This object implements persistence of a collection instance while the instance is referenced in a particular role.

This interface defines a contract between the persistence strategy and the actual persistent collection framework and session. It does not define operations that are required for querying collections, nor for loading by outer join. Implementations are highly coupled to the PersistentCollection hierarchy, since double dispatch is used to load and update collection elements.

Unless a custom PersisterFactory is used, it is expected that implementations of CollectionPersister define a constructor accepting the following arguments:

  1. Collection - The metadata about the collection to be handled by the persister,
  2. CollectionDataAccess - the second level caching strategy for this collection, and
  3. RuntimeModelCreationContext - access to additional information useful while constructing the persister.
See Also: