类 PersistentSet
- java.lang.Object
-
- org.hibernate.collection.internal.AbstractPersistentCollection
-
- org.hibernate.collection.internal.PersistentSet
-
- 所有已实现的接口:
Serializable,Iterable,Collection,Set,PersistentCollection
- 直接已知子类:
PersistentSortedSet
public class PersistentSet extends AbstractPersistentCollection implements Set
A persistent wrapper for a java.util.Set. The underlying collection is a HashSet.
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.hibernate.collection.internal.AbstractPersistentCollection
AbstractPersistentCollection.AbstractValueDelayedOperation, AbstractPersistentCollection.DelayedOperation, AbstractPersistentCollection.IteratorProxy, AbstractPersistentCollection.LazyInitializationWork<T>, AbstractPersistentCollection.ListIteratorProxy, AbstractPersistentCollection.ListProxy, AbstractPersistentCollection.SetProxy, AbstractPersistentCollection.ValueDelayedOperation
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Setsetprotected ListtempList-
从类继承的字段 org.hibernate.collection.internal.AbstractPersistentCollection
elementRemoved, UNKNOWN
-
-
构造器概要
构造器 构造器 说明 PersistentSet()Empty constructor.PersistentSet(SessionImplementor session)已过时。PersistentSet(SharedSessionContractImplementor)should be used instead.PersistentSet(SessionImplementor session, Set set)已过时。PersistentSet(SharedSessionContractImplementor, java.util.Set)should be used instead.PersistentSet(SharedSessionContractImplementor session)Constructor matching super.PersistentSet(SharedSessionContractImplementor session, Set set)Instantiates a non-lazy set (the underlying set is constructed from the incoming set reference).
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanadd(Object value)booleanaddAll(Collection coll)voidbeforeInitialize(CollectionPersister persister, int anticipatedSize)Called before any elements are read into the collection, allowing appropriate initializations to occur.voidbeginRead()Called just before reading any rows from the JDBC result setvoidclear()booleancontains(Object object)booleancontainsAll(Collection coll)Serializabledisassemble(CollectionPersister persister)Disassemble the collection to get it ready for the cachebooleanempty()Is the collection empty?booleanendRead()Called after reading all rows from the JDBC result setIteratorentries(CollectionPersister persister)Iterate all collection entries, during update of the databasebooleanentryExists(Object key, int i)Does the given element/entry exist in the collection?booleanequals(Object other)booleanequalsSnapshot(CollectionPersister persister)Does the current state exactly match the snapshot?IteratorgetDeletes(CollectionPersister persister, boolean indexIsFormula)Get all the elements that need deletingObjectgetElement(Object entry)Get the value of the given collection entry.ObjectgetIndex(Object entry, int i, CollectionPersister persister)Get the index of the given collection entryCollectiongetOrphans(Serializable snapshot, String entityName)get all "orphaned" elementsSerializablegetSnapshot(CollectionPersister persister)Return a new snapshot of the current state of the collectionObjectgetSnapshotElement(Object entry, int i)Get the snapshot value of the given collection entryinthashCode()voidinitializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)Read the state of the collection from a disassembled cached valuebooleanisEmpty()booleanisRowUpdatePossible()Can each element in the collection be mapped unequivocally to a single row in the database?booleanisSnapshotEmpty(Serializable snapshot)Is the snapshot empty?booleanisWrapper(Object collection)Is this the wrapper for the given collection instance?Iteratoriterator()booleanneedsInserting(Object entry, int i, Type elemType)Do we need to insert this element?booleanneedsUpdating(Object entry, int i, Type elemType)Do we need to update this element?ObjectreadFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)Read a row from the JDBC result setbooleanremove(Object value)booleanremoveAll(Collection coll)booleanretainAll(Collection coll)intsize()Object[]toArray()Object[]toArray(Object[] array)StringtoString()-
从类继承的方法 org.hibernate.collection.internal.AbstractPersistentCollection
afterInitialize, afterRowInsert, clearDirty, clearOperationQueue, dirty, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, identityRemove, identityRemove, initialize, isClearQueueEnabled, isConnectedToSession, isDirectlyAccessible, isDirty, isElementRemoved, isInitialized, isInverseCollection, isInverseCollectionNoOrphanDelete, isInverseOneToManyOrNoOrphanDelete, isOperationQueueEnabled, isPutQueueEnabled, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, prepareForPossibleLoadingOutsideTransaction, queuedAdditionIterator, queueOperation, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, replaceQueuedOperationValues, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write
-
从接口继承的方法 java.util.Collection
parallelStream, removeIf, stream, toArray
-
从接口继承的方法 org.hibernate.collection.spi.PersistentCollection
isDirectlyProvidedCollection
-
从接口继承的方法 java.util.Set
spliterator
-
-
-
-
构造器详细资料
-
PersistentSet
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
public PersistentSet(SharedSessionContractImplementor session)
Constructor matching super. Instantiates a lazy set (the underlying set is un-initialized).- 参数:
session- The session to which this set will belong.
-
PersistentSet
@Deprecated public PersistentSet(SessionImplementor session)
已过时。PersistentSet(SharedSessionContractImplementor)should be used instead.Instantiates a lazy set (the underlying set is un-initialized).- 参数:
session- The session to which this set will belong.
-
PersistentSet
public PersistentSet(SharedSessionContractImplementor session, Set set)
Instantiates a non-lazy set (the underlying set is constructed from the incoming set reference).- 参数:
session- The session to which this set will belong.set- The underlying set data.
-
PersistentSet
@Deprecated public PersistentSet(SessionImplementor session, Set set)
已过时。PersistentSet(SharedSessionContractImplementor, java.util.Set)should be used instead.Instantiates a non-lazy set (the underlying set is constructed from the incoming set reference).- 参数:
session- The session to which this set will belong.set- The underlying set data.
-
-
方法详细资料
-
getSnapshot
public Serializable getSnapshot(CollectionPersister persister) throws HibernateException
从接口复制的说明:PersistentCollectionReturn a new snapshot of the current state of the collection- 指定者:
getSnapshot在接口中PersistentCollection- 参数:
persister- The collection persister- 返回:
- The snapshot
- 抛出:
HibernateException
-
getOrphans
public Collection getOrphans(Serializable snapshot, String entityName) throws HibernateException
从接口复制的说明:PersistentCollectionget all "orphaned" elements- 指定者:
getOrphans在接口中PersistentCollection- 指定者:
getOrphans在类中AbstractPersistentCollection- 参数:
snapshot- The snapshot stateentityName- The name of the entity that are the elements of the collection- 返回:
- The orphans
- 抛出:
HibernateException
-
equalsSnapshot
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException
从接口复制的说明:PersistentCollectionDoes the current state exactly match the snapshot?- 指定者:
equalsSnapshot在接口中PersistentCollection- 参数:
persister- The collection persister- 返回:
trueif the current state and the snapshot state match.- 抛出:
HibernateException
-
isSnapshotEmpty
public boolean isSnapshotEmpty(Serializable snapshot)
从接口复制的说明:PersistentCollectionIs the snapshot empty?- 指定者:
isSnapshotEmpty在接口中PersistentCollection- 参数:
snapshot- The snapshot to check- 返回:
trueif the given snapshot is empty
-
beforeInitialize
public void beforeInitialize(CollectionPersister persister, int anticipatedSize)
从接口复制的说明:PersistentCollectionCalled before any elements are read into the collection, allowing appropriate initializations to occur.- 指定者:
beforeInitialize在接口中PersistentCollection- 参数:
persister- The underlying collection persister.anticipatedSize- The anticipated size of the collection after initialization is complete.
-
initializeFromCache
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException
从接口复制的说明:PersistentCollectionRead the state of the collection from a disassembled cached value- 指定者:
initializeFromCache在接口中PersistentCollection- 参数:
persister- The collection persisterdisassembled- The disassembled cached stateowner- The collection owner- 抛出:
HibernateException
-
empty
public boolean empty()
从接口复制的说明:PersistentCollectionIs the collection empty? (don't try to initialize the collection)- 指定者:
empty在接口中PersistentCollection- 指定者:
empty在类中AbstractPersistentCollection- 返回:
falseif the collection is non-empty;trueotherwise.
-
size
public int size()
- 指定者:
size在接口中Collection- 指定者:
size在接口中Set
-
isEmpty
public boolean isEmpty()
- 指定者:
isEmpty在接口中Collection- 指定者:
isEmpty在接口中Set
-
contains
public boolean contains(Object object)
- 指定者:
contains在接口中Collection- 指定者:
contains在接口中Set
-
iterator
public Iterator iterator()
-
toArray
public Object[] toArray()
- 指定者:
toArray在接口中Collection- 指定者:
toArray在接口中Set
-
add
public boolean add(Object value)
- 指定者:
add在接口中Collection- 指定者:
add在接口中Set
-
remove
public boolean remove(Object value)
- 指定者:
remove在接口中Collection- 指定者:
remove在接口中Set
-
containsAll
public boolean containsAll(Collection coll)
- 指定者:
containsAll在接口中Collection- 指定者:
containsAll在接口中Set
-
addAll
public boolean addAll(Collection coll)
- 指定者:
addAll在接口中Collection- 指定者:
addAll在接口中Set
-
retainAll
public boolean retainAll(Collection coll)
- 指定者:
retainAll在接口中Collection- 指定者:
retainAll在接口中Set
-
removeAll
public boolean removeAll(Collection coll)
- 指定者:
removeAll在接口中Collection- 指定者:
removeAll在接口中Set
-
clear
public void clear()
- 指定者:
clear在接口中Collection- 指定者:
clear在接口中Set
-
readFrom
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner) throws HibernateException, SQLException
从接口复制的说明:PersistentCollectionRead a row from the JDBC result set- 指定者:
readFrom在接口中PersistentCollection- 参数:
rs- The JDBC ResultSetpersister- The collection roledescriptor- The aliases used for the columns making up the collectionowner- The collection owner- 返回:
- The read object
- 抛出:
HibernateException- Generally indicates a problem resolving data read from the ResultSetSQLException- Indicates a problem accessing the ResultSet
-
beginRead
public void beginRead()
从接口复制的说明:PersistentCollectionCalled just before reading any rows from the JDBC result set- 指定者:
beginRead在接口中PersistentCollection- 覆盖:
beginRead在类中AbstractPersistentCollection
-
endRead
public boolean endRead()
从接口复制的说明:PersistentCollectionCalled after reading all rows from the JDBC result set- 指定者:
endRead在接口中PersistentCollection- 覆盖:
endRead在类中AbstractPersistentCollection- 返回:
- Whether to end the read.
-
entries
public Iterator entries(CollectionPersister persister)
从接口复制的说明:PersistentCollectionIterate all collection entries, during update of the database- 指定者:
entries在接口中PersistentCollection- 参数:
persister- The collection persister.- 返回:
- The iterator
-
disassemble
public Serializable disassemble(CollectionPersister persister) throws HibernateException
从接口复制的说明:PersistentCollectionDisassemble the collection to get it ready for the cache- 指定者:
disassemble在接口中PersistentCollection- 参数:
persister- The collection persister- 返回:
- The disassembled state
- 抛出:
HibernateException
-
getDeletes
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException
从接口复制的说明:PersistentCollectionGet all the elements that need deleting- 指定者:
getDeletes在接口中PersistentCollection- 参数:
persister- The collection persisterindexIsFormula- For indexed collections, tells whether the index is a formula (calculated value) mapping- 返回:
- An iterator over the elements to delete
- 抛出:
HibernateException
-
needsInserting
public boolean needsInserting(Object entry, int i, Type elemType) throws HibernateException
从接口复制的说明:PersistentCollectionDo we need to insert this element?- 指定者:
needsInserting在接口中PersistentCollection- 参数:
entry- The collection element to checki- The index (for indexed collections)elemType- The type for the element- 返回:
trueif the element needs inserting- 抛出:
HibernateException
-
needsUpdating
public boolean needsUpdating(Object entry, int i, Type elemType)
从接口复制的说明:PersistentCollectionDo we need to update this element?- 指定者:
needsUpdating在接口中PersistentCollection- 参数:
entry- The collection element to checki- The index (for indexed collections)elemType- The type for the element- 返回:
trueif the element needs updating
-
isRowUpdatePossible
public boolean isRowUpdatePossible()
从接口复制的说明:PersistentCollectionCan 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.- 指定者:
isRowUpdatePossible在接口中PersistentCollection- 覆盖:
isRowUpdatePossible在类中AbstractPersistentCollection- 返回:
trueif the row for each element is known
-
getIndex
public Object getIndex(Object entry, int i, CollectionPersister persister)
从接口复制的说明:PersistentCollectionGet the index of the given collection entry- 指定者:
getIndex在接口中PersistentCollection- 参数:
entry- The collection entry/elementi- The assumed indexpersister- it was more elegant before we added this...- 返回:
- The index value
-
getElement
public Object getElement(Object entry)
从接口复制的说明:PersistentCollectionGet 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.- 指定者:
getElement在接口中PersistentCollection- 参数:
entry- The object instance for which to get the collection element instance.- 返回:
- The corresponding object that is part of the collection elements.
-
getSnapshotElement
public Object getSnapshotElement(Object entry, int i)
从接口复制的说明:PersistentCollectionGet the snapshot value of the given collection entry- 指定者:
getSnapshotElement在接口中PersistentCollection- 参数:
entry- The entryi- The index- 返回:
- The snapshot state for that element
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
entryExists
public boolean entryExists(Object key, int i)
从接口复制的说明:PersistentCollectionDoes the given element/entry exist in the collection?- 指定者:
entryExists在接口中PersistentCollection- 参数:
key- The object to check if it exists as a collection elementi- Unused- 返回:
trueif the given entry is a collection element
-
isWrapper
public boolean isWrapper(Object collection)
从接口复制的说明:PersistentCollectionIs this the wrapper for the given collection instance?- 指定者:
isWrapper在接口中PersistentCollection- 参数:
collection- The collection to check whether this is wrapping it- 返回:
trueif this is a wrapper around that given collection instance.
-
-