类 PersistentArrayHolder
- java.lang.Object
-
- org.hibernate.collection.internal.AbstractPersistentCollection
-
- org.hibernate.collection.internal.PersistentArrayHolder
-
- 所有已实现的接口:
Serializable,PersistentCollection
public class PersistentArrayHolder extends AbstractPersistentCollection
A persistent wrapper for an array. Lazy initialization is NOT supported. Use of Hibernate arrays is not really recommended.- 作者:
- Gavin King
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
-
从类继承的嵌套类/接口 org.hibernate.collection.internal.AbstractPersistentCollection
AbstractPersistentCollection.AbstractValueDelayedOperation, AbstractPersistentCollection.DelayedOperation, AbstractPersistentCollection.IteratorProxy, AbstractPersistentCollection.LazyInitializationWork<T>, AbstractPersistentCollection.ListIteratorProxy, AbstractPersistentCollection.ListProxy, AbstractPersistentCollection.SetProxy, AbstractPersistentCollection.ValueDelayedOperation
-
-
字段概要
字段 修饰符和类型 字段 说明 protected Objectarray-
从类继承的字段 org.hibernate.collection.internal.AbstractPersistentCollection
elementRemoved, UNKNOWN
-
-
构造器概要
构造器 构造器 说明 PersistentArrayHolder(SessionImplementor session, Object array)已过时。PersistentArrayHolder(SharedSessionContractImplementor, Object)should be used instead.PersistentArrayHolder(SessionImplementor session, CollectionPersister persister)已过时。PersistentArrayHolder(SharedSessionContractImplementor, CollectionPersister)should be used instead.PersistentArrayHolder(SharedSessionContractImplementor session, Object array)Constructs a PersistentCollection instance for holding an array.PersistentArrayHolder(SharedSessionContractImplementor session, CollectionPersister persister)Constructs a PersistentCollection instance for holding an array.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 setSerializabledisassemble(CollectionPersister persister)Disassemble the collection to get it ready for the cacheIteratorelements()Get an iterator over the array elementsbooleanempty()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 entry, int i)Does the given element/entry exist in the collection?booleanequalsSnapshot(CollectionPersister persister)Does the current state exactly match the snapshot?ObjectgetArray()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 entryObjectgetValue()Return the user-visible collection (or array) instancevoidinitializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)Read the state of the collection from a disassembled cached valuebooleanisDirectlyAccessible()Could the application possibly have a direct reference to the underlying collection implementation?booleanisSnapshotEmpty(Serializable snapshot)Is the snapshot empty?booleanisWrapper(Object collection)Is this the wrapper for the given collection instance?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 set-
从类继承的方法 org.hibernate.collection.internal.AbstractPersistentCollection
afterInitialize, afterRowInsert, clearDirty, clearOperationQueue, dirty, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, hasQueuedOperations, identityRemove, identityRemove, initialize, isClearQueueEnabled, isConnectedToSession, 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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.collection.spi.PersistentCollection
isDirectlyProvidedCollection
-
-
-
-
字段详细资料
-
array
protected Object array
-
-
构造器详细资料
-
PersistentArrayHolder
public PersistentArrayHolder(SharedSessionContractImplementor session, Object array)
Constructs a PersistentCollection instance for holding an array.- 参数:
session- The sessionarray- The array (the persistent "collection").
-
PersistentArrayHolder
@Deprecated public PersistentArrayHolder(SessionImplementor session, Object array)
已过时。PersistentArrayHolder(SharedSessionContractImplementor, Object)should be used instead.Constructs a PersistentCollection instance for holding an array.- 参数:
session- The sessionarray- The array (the persistent "collection").
-
PersistentArrayHolder
public PersistentArrayHolder(SharedSessionContractImplementor session, CollectionPersister persister)
Constructs a PersistentCollection instance for holding an array.- 参数:
session- The sessionpersister- The persister for the array
-
PersistentArrayHolder
@Deprecated public PersistentArrayHolder(SessionImplementor session, CollectionPersister persister)
已过时。PersistentArrayHolder(SharedSessionContractImplementor, CollectionPersister)should be used instead.Constructs a PersistentCollection instance for holding an array.- 参数:
session- The sessionpersister- The persister for the array
-
-
方法详细资料
-
getSnapshot
public Serializable getSnapshot(CollectionPersister persister) throws HibernateException
从接口复制的说明:PersistentCollectionReturn a new snapshot of the current state of the collection- 参数:
persister- The collection persister- 返回:
- The snapshot
- 抛出:
HibernateException
-
isSnapshotEmpty
public boolean isSnapshotEmpty(Serializable snapshot)
从接口复制的说明:PersistentCollectionIs the snapshot empty?- 参数:
snapshot- The snapshot to check- 返回:
trueif the given snapshot is empty
-
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
-
getArray
public Object getArray()
-
isWrapper
public boolean isWrapper(Object collection)
从接口复制的说明:PersistentCollectionIs this the wrapper for the given collection instance?- 参数:
collection- The collection to check whether this is wrapping it- 返回:
trueif this is a wrapper around that given collection instance.
-
equalsSnapshot
public boolean equalsSnapshot(CollectionPersister persister) throws HibernateException
从接口复制的说明:PersistentCollectionDoes the current state exactly match the snapshot?- 参数:
persister- The collection persister- 返回:
trueif the current state and the snapshot state match.- 抛出:
HibernateException
-
elements
public Iterator elements()
Get an iterator over the array elements- 返回:
- The iterator
-
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- 参数:
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- 参数:
persister- The collection persister.- 返回:
- The iterator
-
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.
-
beforeInitialize
public void beforeInitialize(CollectionPersister persister, int anticipatedSize)
从接口复制的说明:PersistentCollectionCalled before any elements are read into the collection, allowing appropriate initializations to occur.- 参数:
persister- The underlying collection persister.anticipatedSize- The anticipated size of the collection after initialization is complete.
-
isDirectlyAccessible
public boolean isDirectlyAccessible()
从接口复制的说明:PersistentCollectionCould the application possibly have a direct reference to the underlying collection implementation?- 指定者:
isDirectlyAccessible在接口中PersistentCollection- 覆盖:
isDirectlyAccessible在类中AbstractPersistentCollection- 返回:
trueindicates that the application might have access to the underlying collection/array.
-
initializeFromCache
public void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException
从接口复制的说明:PersistentCollectionRead the state of the collection from a disassembled cached value- 参数:
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- 参数:
persister- The collection persister- 返回:
- The disassembled state
- 抛出:
HibernateException
-
getValue
public Object getValue()
从接口复制的说明:PersistentCollectionReturn the user-visible collection (or array) instance- 指定者:
getValue在接口中PersistentCollection- 覆盖:
getValue在类中AbstractPersistentCollection- 返回:
- The underlying collection/array
-
getDeletes
public Iterator getDeletes(CollectionPersister persister, boolean indexIsFormula) throws HibernateException
从接口复制的说明:PersistentCollectionGet all the elements that need deleting- 参数:
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?- 参数:
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?- 参数:
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- 参数:
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.- 参数:
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- 参数:
entry- The entryi- The index- 返回:
- The snapshot state for that element
-
entryExists
public boolean entryExists(Object entry, int i)
从接口复制的说明:PersistentCollectionDoes the given element/entry exist in the collection?- 参数:
entry- The object to check if it exists as a collection elementi- Unused- 返回:
trueif the given entry is a collection element
-
-