java.util.Set . The underlying
collection is a HashSet.
API Note
Incubating in terms of making this non-internal. These contracts will be getting cleaned up in following releases.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| pack-priv class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| protected Set |
| Access | Constructor and Description |
|---|---|
| public | |
| public | PersistentSet(SharedSessionContractImplementor
The session to which this set will belong. session)Constructor matching super. |
| public | PersistentSet(SharedSessionContractImplementor
The session to which this set will belong. session, Set<E> The underlying set data. set)Instantiates a non-lazy set (the underlying set is constructed from the incoming set reference). |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | add(E
element to be added to this set value)Implements java. |
| public boolean | addAll(Collection<? extends E>
collection containing elements to be added to this set coll)Implements java. |
| public void | clear()
Implements java. |
| public boolean | contains(Object
element whose presence in this set is to be tested object)Implements java. true if this set contains the specified element.
|
| public boolean | containsAll(Collection<?>
collection to be checked for containment in this set coll)Implements java. true if this set contains all of the elements of the
specified collection.
|
| public Object | disassemble(CollectionPersister
The collection persister persister)Implements org. |
| public boolean | empty()
Implements abstract org. Implements org. |
| public Iterator | entries(CollectionPersister
The collection persister. persister)Implements org. |
| public boolean | entryExists(Object
The object to check if it exists as a collection element key, int Unused i)Implements org. |
| public boolean | equals(Object
object to be compared for equality with this set other)Overrides java. Implements java. |
| public boolean | equalsSnapshot(CollectionPersister
The collection persister persister)Implements org. |
| public Iterator | getDeletes(CollectionPersister
The collection persister persister, boolean For indexed collections, tells whether the index is a formula (calculated value) mapping indexIsFormula)Implements org. |
| public Object | getElement(Object
The object instance for which to get the collection element instance. entry)Implements org. |
| public Object | getIndex(Object
The collection entry/element entry, int The assumed index i, CollectionPersister it was more elegant before we added this... persister)Implements org. |
| public Collection | getOrphans(Serializable
The snapshot state snapshot, String The name of the entity that are the elements of the collection entityName)Implements abstract org. Implements org. |
| public Serializable | getSnapshot(CollectionPersister
The collection persister persister)Implements org. |
| public Object | getSnapshotElement(Object
The entry entry, int The index i)Implements org. |
| public int | hashCode()
Overrides java. Implements java. |
| public void | |
| public void | initializeFromCache(CollectionPersister
The collection persister persister, Object The disassembled cached state disassembled, Object The collection owner owner)Implements org. |
| public void | injectLoadedState(PluralAttributeMapping attributeMapping, List<?> loadingStateList)
Implements org. |
| public boolean | |
| public boolean | isRowUpdatePossible()
Overrides org. Implements org. |
| public boolean | isSnapshotEmpty(Serializable
The snapshot to check snapshot)Implements org. |
| public boolean | isWrapper(Object
The collection to check whether this is wrapping it collection)Implements org. |
| public Iterator | |
| public boolean | needsInserting(Object
The collection element to check entry, int The index (for indexed collections) i, Type The type for the element elemType)Implements org. |
| public boolean | needsUpdating(Object
The collection element to check entry, int The index (for indexed collections) i, Type The type for the element elemType)Implements org. |
| public boolean | remove(Object
object to be removed from this set, if present value)Implements java. |
| public boolean | removeAll(Collection<?>
collection containing elements to be removed from this set coll)Implements java. |
| public boolean | retainAll(Collection<?>
collection containing elements to be retained in this set coll)Implements java. |
| public int | |
| public Object[] | toArray()
Implements java. |
| public <A> A[] | toArray(A[]
the array into which the elements of this set are to be
stored, if it is big enough; otherwise, a new array of the same
runtime type is allocated for this purpose. array)Implements java. |
| public String |
| set | back to summary |
|---|---|
| protected Set<E> set | |
| PersistentSet | back to summary |
|---|---|
| public PersistentSet() Empty constructor. Note this form is not ever ever ever used by Hibernate; it is, however, needed for SOAP libraries and other such marshalling code. | |
| PersistentSet | back to summary |
|---|---|
| public PersistentSet(SharedSessionContractImplementor session) Constructor matching super. Instantiates a lazy set (the underlying set is un-initialized).
| |
| PersistentSet | back to summary |
|---|---|
| public PersistentSet(SharedSessionContractImplementor session, Set<E> set) Instantiates a non-lazy set (the underlying set is constructed from the incoming set reference).
| |
| add | back to summary |
|---|---|
| public boolean add(E value) Implements java. Doc from java. Adds the specified element to this set if it is not already present
(optional operation). More formally, adds the specified element
The stipulation above does not imply that sets must accept all
elements; sets may refuse to add any particular element, including
| |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends E> coll) Implements java. Doc from java. Adds all of the elements in the specified collection to this set if
they're not already present (optional operation). If the specified
collection is also a set, the
| |
| clear | back to summary |
|---|---|
| public void clear() Implements java. Doc from java. Removes all of the elements from this set (optional operation). The set will be empty after this call returns.
| |
| contains | back to summary |
|---|---|
| public boolean contains(Object object) Implements java. Doc from java. Returns | |
| containsAll | back to summary |
|---|---|
| public boolean containsAll(Collection<?> coll) Implements java. Doc from java. Returns
| |
| disassemble | back to summary |
|---|---|
| public Object disassemble(CollectionPersister persister) throws HibernateException Implements org. Doc from org. Disassemble the collection to get it ready for the cache
| |
| empty | back to summary |
|---|---|
| public boolean empty() Implements abstract org. Implements org. Doc from org. Is the collection empty? (don't try to initialize the collection)
| |
| entries | back to summary |
|---|---|
| public Iterator Implements org. Doc from org. Iterate all collection entries, during update of the database
| |
| entryExists | back to summary |
|---|---|
| public boolean entryExists(Object key, int i) Implements org. Doc from org. Does the given element/entry exist in the collection? | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Implements java. Doc from java. Compares the specified object with this set for equality. Returns
| |
| equalsSnapshot | back to summary |
|---|---|
| public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException Implements org. Doc from org. Does the current state exactly match the snapshot?
| |
| getDeletes | back to summary |
|---|---|
| public Iterator Implements org. Doc from org. Get all the elements that need deleting
| |
| getElement | back to summary |
|---|---|
| public Object getElement(Object entry) Implements org. Doc from org. Get the value of the given collection entry. Generally the given entry parameter value will just be returned. Might get a different value for a duplicate entries in a Set. | |
| getIndex | back to summary |
|---|---|
| public Object getIndex(Object entry, int i, CollectionPersister persister) Implements org. Doc from org. Get the index of the given collection entry
| |
| getOrphans | back to summary |
|---|---|
| public Collection Implements abstract org. Implements org. Doc from org. get all "orphaned" elements
| |
| getSnapshot | back to summary |
|---|---|
| public Serializable getSnapshot(CollectionPersister persister) throws HibernateException Implements org. Doc from org. Return a new snapshot of the current state of the collection
| |
| getSnapshotElement | back to summary |
|---|---|
| public Object getSnapshotElement(Object entry, int i) Implements org. Doc from org. Get the snapshot value of the given collection entry | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. Returns the hash code value for this set. The hash code of a set is
defined to be the sum of the hash codes of the elements in the set,
where the hash code of a
| |
| initializeEmptyCollection | back to summary |
|---|---|
| public void initializeEmptyCollection(CollectionPersister persister) Implements org.
| |
| initializeFromCache | back to summary |
|---|---|
| public void initializeFromCache(CollectionPersister persister, Object disassembled, Object owner) throws HibernateException Implements org. Doc from org. Read the state of the collection from a disassembled cached value
| |
| injectLoadedState | back to summary |
|---|---|
| public void injectLoadedState(PluralAttributeMapping attributeMapping, List<?> loadingStateList) Implements org. Doc from org. Inject the state loaded for a collection instance. | |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements java. Doc from java. Returns
| |
| isRowUpdatePossible | back to summary |
|---|---|
| public boolean isRowUpdatePossible() Overrides org. Implements org. Doc from org. Can each element in the collection be mapped unequivocally to a single row in the database? Generally bags and sets are the only collections that cannot be.
| |
| isSnapshotEmpty | back to summary |
|---|---|
| public boolean isSnapshotEmpty(Serializable snapshot) Implements org. Doc from org. Is the snapshot empty?
| |
| isWrapper | back to summary |
|---|---|
| public boolean isWrapper(Object collection) Implements org. Doc from org. Is this the wrapper for the given collection instance? | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee). | |
| needsInserting | back to summary |
|---|---|
| public boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException Implements org. Doc from org. Do we need to insert this element? | |
| needsUpdating | back to summary |
|---|---|
| public boolean needsUpdating(Object entry, int i, Type elemType) Implements org. Doc from org. Do we need to update this element? | |
| remove | back to summary |
|---|---|
| public boolean remove(Object value) Implements java. Doc from java. Removes the specified element from this set if it is present
(optional operation). More formally, removes an element | |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> coll) Implements java. Doc from java. Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the asymmetric set difference of the two sets.
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> coll) Implements java. Doc from java. Retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection. If the specified collection is also a set, this operation effectively modifies this set so that its value is the intersection of the two sets.
| |
| size | back to summary |
|---|---|
| public int size() Implements java. Doc from java. Returns the number of elements in this set (its cardinality). If this
set contains more than
| |
| toArray | back to summary |
|---|---|
| public Object[] toArray() Implements java. Doc from java. Returns an array containing all of the elements in this set. If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. The returned array will be "safe" in that no references to it are maintained by this set. (In other words, this method must allocate a new array even if this set is backed by an array). The caller is thus free to modify the returned array. This method acts as bridge between array-based and collection-based APIs. | |
| toArray | back to summary |
|---|---|
| public <A> A[] toArray(A[] array) Implements java. Doc from java. Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array. If the set fits in the specified array, it is returned therein. Otherwise, a new array is allocated with the runtime type of the specified array and the size of this set. If this set fits in the specified array with room to spare
(i.e., the array has more elements than this set), the element in
the array immediately following the end of the set is set to
If this set makes any guarantees as to what order its elements are returned by its iterator, this method must return the elements in the same order. Like the Suppose
String[] y = x.toArray(new String[0]);
Note that toArray(new Object[0]) is identical in function to
toArray().
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public E | |
| public E | |
| public void |
| Clear | back to summary |
|---|---|
| pack-priv Clear() | |
| getAddedInstance | back to summary |
|---|---|
| public E getAddedInstance() Implements org.
| |
| getOrphan | back to summary |
|---|---|
| public E getOrphan() Implements org.
| |
| operate | back to summary |
|---|---|
| public void operate() Implements org.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| SimpleAdd | back to summary |
|---|---|
| public SimpleAdd(E addedValue) | |
| operate | back to summary |
|---|---|
| public void operate() Implements org.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| SimpleRemove | back to summary |
|---|---|
| public SimpleRemove(E orphan) | |
| operate | back to summary |
|---|---|
| public void operate() Implements org.
| |