Implements "bag" semantics more efficiently than a regular PersistentBag by adding a synthetic identifier column to the table.

Namespace:  NHibernate.Collection
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
<SerializableAttribute> _
Public Class PersistentIdentifierBag _
	Inherits AbstractPersistentCollection _
	Implements IList, ICollection, IEnumerable
C#
[SerializableAttribute]
public class PersistentIdentifierBag : AbstractPersistentCollection, 
	IList, ICollection, IEnumerable
Visual C++
[SerializableAttribute]
public ref class PersistentIdentifierBag : public AbstractPersistentCollection, 
	IList, ICollection, IEnumerable
JavaScript
NHibernate.Collection.PersistentIdentifierBag = function();

Type.createClass(
	'NHibernate.Collection.PersistentIdentifierBag',
	NHibernate.Collection.AbstractPersistentCollection,
	IList,
	ICollection,
	IEnumerable);

Remarks

The identifier is unique for all rows in the table, allowing very efficient updates and deletes. The value of the identifier is never exposed to the application.

PersistentIdentifierBags may not be used for a many-to-one association. Furthermore, there is no reason to use inverse="true".

Inheritance Hierarchy

System..::.Object
  NHibernate.Collection..::.AbstractPersistentCollection
    NHibernate.Collection..::.PersistentIdentifierBag

See Also