类 PersistentList
- java.lang.Object
-
- org.hibernate.collection.internal.AbstractPersistentCollection
-
- org.hibernate.collection.internal.PersistentList
-
- 所有已实现的接口:
Serializable,Iterable,Collection,List,PersistentCollection
public class PersistentList extends AbstractPersistentCollection implements List
A persistent wrapper for a java.util.List. Underlying collection is an ArrayList.
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.hibernate.collection.internal.AbstractPersistentCollection
AbstractPersistentCollection.AbstractValueDelayedOperation, AbstractPersistentCollection.DelayedOperation, AbstractPersistentCollection.IteratorProxy, AbstractPersistentCollection.LazyInitializationWork<T>, AbstractPersistentCollection.ListIteratorProxy, AbstractPersistentCollection.ListProxy, AbstractPersistentCollection.SetProxy, AbstractPersistentCollection.ValueDelayedOperation
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Listlist-
从类继承的字段 org.hibernate.collection.internal.AbstractPersistentCollection
elementRemoved, UNKNOWN
-
-
构造器概要
构造器 构造器 说明 PersistentList()Constructs a PersistentList.PersistentList(SessionImplementor session)已过时。PersistentList(SharedSessionContractImplementor)should be used instead.PersistentList(SessionImplementor session, List list)已过时。PersistentList(SharedSessionContractImplementor, List)should be used instead.PersistentList(SharedSessionContractImplementor session)Constructs a PersistentList.PersistentList(SharedSessionContractImplementor session, List list)Constructs a PersistentList.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidadd(int index, Object value)booleanadd(Object object)booleanaddAll(int index, Collection coll)booleanaddAll(Collection values)voidbeforeInitialize(CollectionPersister persister, int anticipatedSize)Called before any elements are read into the collection, allowing appropriate initializations to occur.voidclear()booleancontains(Object object)booleancontainsAll(Collection coll)Serializabledisassemble(CollectionPersister persister)Disassemble the collection to get it ready for the cachebooleanempty()Is the collection empty?Iteratorentries(CollectionPersister persister)Iterate all collection entries, during update of the databasebooleanentryExists(Object entry, 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?Objectget(int index)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()intindexOf(Object value)voidinitializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)Read the state of the collection from a disassembled cached valuebooleanisEmpty()booleanisSnapshotEmpty(Serializable snapshot)Is the snapshot empty?booleanisWrapper(Object collection)Is this the wrapper for the given collection instance?Iteratoriterator()intlastIndexOf(Object value)ListIteratorlistIterator()ListIteratorlistIterator(int index)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 setObjectremove(int index)booleanremove(Object value)booleanremoveAll(Collection coll)booleanretainAll(Collection coll)Objectset(int index, Object value)intsize()ListsubList(int from, int to)Object[]toArray()Object[]toArray(Object[] array)StringtoString()-
从类继承的方法 org.hibernate.collection.internal.AbstractPersistentCollection
afterInitialize, afterRowInsert, beginRead, clearDirty, clearOperationQueue, dirty, endRead, 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, isRowUpdatePossible, 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
-
从接口继承的方法 java.util.List
replaceAll, sort, spliterator
-
从接口继承的方法 org.hibernate.collection.spi.PersistentCollection
isDirectlyProvidedCollection
-
-
-
-
字段详细资料
-
list
protected List list
-
-
构造器详细资料
-
PersistentList
public PersistentList()
Constructs a PersistentList. This form needed for SOAP libraries, etc
-
PersistentList
public PersistentList(SharedSessionContractImplementor session)
Constructs a PersistentList.- 参数:
session- The session
-
PersistentList
@Deprecated public PersistentList(SessionImplementor session)
已过时。PersistentList(SharedSessionContractImplementor)should be used instead.Constructs a PersistentList.- 参数:
session- The session
-
PersistentList
public PersistentList(SharedSessionContractImplementor session, List list)
Constructs a PersistentList.- 参数:
session- The sessionlist- The raw list
-
PersistentList
@Deprecated public PersistentList(SessionImplementor session, List list)
已过时。PersistentList(SharedSessionContractImplementor, List)should be used instead.Constructs a PersistentList.- 参数:
session- The sessionlist- The raw list
-
-
方法详细资料
-
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.
-
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.
-
size
public int size()
- 指定者:
size在接口中Collection- 指定者:
size在接口中List
-
isEmpty
public boolean isEmpty()
- 指定者:
isEmpty在接口中Collection- 指定者:
isEmpty在接口中List
-
contains
public boolean contains(Object object)
- 指定者:
contains在接口中Collection- 指定者:
contains在接口中List
-
iterator
public Iterator iterator()
-
toArray
public Object[] toArray()
- 指定者:
toArray在接口中Collection- 指定者:
toArray在接口中List
-
toArray
public Object[] toArray(Object[] array)
- 指定者:
toArray在接口中Collection- 指定者:
toArray在接口中List
-
add
public boolean add(Object object)
- 指定者:
add在接口中Collection- 指定者:
add在接口中List
-
remove
public boolean remove(Object value)
- 指定者:
remove在接口中Collection- 指定者:
remove在接口中List
-
containsAll
public boolean containsAll(Collection coll)
- 指定者:
containsAll在接口中Collection- 指定者:
containsAll在接口中List
-
addAll
public boolean addAll(Collection values)
- 指定者:
addAll在接口中Collection- 指定者:
addAll在接口中List
-
addAll
public boolean addAll(int index, Collection coll)
-
removeAll
public boolean removeAll(Collection coll)
- 指定者:
removeAll在接口中Collection- 指定者:
removeAll在接口中List
-
retainAll
public boolean retainAll(Collection coll)
- 指定者:
retainAll在接口中Collection- 指定者:
retainAll在接口中List
-
clear
public void clear()
- 指定者:
clear在接口中Collection- 指定者:
clear在接口中List
-
lastIndexOf
public int lastIndexOf(Object value)
- 指定者:
lastIndexOf在接口中List
-
listIterator
public ListIterator listIterator()
- 指定者:
listIterator在接口中List
-
listIterator
public ListIterator listIterator(int index)
- 指定者:
listIterator在接口中List
-
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.
-
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
-
entries
public Iterator entries(CollectionPersister persister)
从接口复制的说明:PersistentCollectionIterate all collection entries, during update of the database- 指定者:
entries在接口中PersistentCollection- 参数:
persister- The collection persister.- 返回:
- The iterator
-
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
-
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) throws HibernateException
从接口复制的说明: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- 抛出:
HibernateException
-
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 entry, int i)
从接口复制的说明:PersistentCollectionDoes the given element/entry exist in the collection?- 指定者:
entryExists在接口中PersistentCollection- 参数:
entry- The object to check if it exists as a collection elementi- Unused- 返回:
trueif the given entry is a collection element
-
-