org.hibernate.collection

Class PersistentList

Implemented Interfaces:
List, Serializable, PersistentCollection

public class PersistentList
extends AbstractPersistentCollection
implements List

A persistent wrapper for a java.util.List. Underlying collection is an ArrayList.
Author:
Gavin King
See Also:
java.util.ArrayList

Nested Class Summary

Nested classes/interfaces inherited from class org.hibernate.collection.AbstractPersistentCollection

AbstractPersistentCollection.DelayedOperation

Field Summary

protected List
list

Fields inherited from class org.hibernate.collection.AbstractPersistentCollection

UNKNOWN

Constructor Summary

PersistentList()
PersistentList(SessionImplementor session)
PersistentList(SessionImplementor session, List list)

Method Summary

boolean
add(Object object)
void
add(int index, Object value)
boolean
addAll(Collection values)
boolean
addAll(int index, Collection coll)
void
beforeInitialize(CollectionPersister persister, int anticipatedSize)
void
clear()
boolean
contains(Object object)
boolean
containsAll(Collection coll)
Serializable
disassemble(CollectionPersister persister)
boolean
empty()
Iterator
entries(CollectionPersister persister)
boolean
entryExists(Object entry, int i)
boolean
equals(Object other)
boolean
equalsSnapshot(CollectionPersister persister)
Object
get(int index)
Iterator
getDeletes(CollectionPersister persister, boolean indexIsFormula)
Object
getElement(Object entry)
Object
getIndex(Object entry, int i, CollectionPersister persister)
Collection
getOrphans(Serializable snapshot, String entityName)
Serializable
getSnapshot(CollectionPersister persister)
Object
getSnapshotElement(Object entry, int i)
int
hashCode()
int
indexOf(Object value)
void
initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
boolean
isEmpty()
boolean
isSnapshotEmpty(Serializable snapshot)
boolean
isWrapper(Object collection)
Iterator
iterator()
int
lastIndexOf(Object value)
ListIterator
listIterator()
ListIterator
listIterator(int index)
boolean
needsInserting(Object entry, int i, Type elemType)
boolean
needsUpdating(Object entry, int i, Type elemType)
Object
readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)
boolean
remove(Object value)
Object
remove(int index)
boolean
removeAll(Collection coll)
boolean
retainAll(Collection coll)
Object
set(int index, Object value)
int
size()
List
subList(int from, int to)
Object[]
toArray()
Object[]
toArray(Object[] array)
String
toString()

Methods inherited from class org.hibernate.collection.AbstractPersistentCollection

afterInitialize, afterRowInsert, beginRead, clearDirty, dirty, empty, endRead, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, initialize, isClearQueueEnabled, isDirectlyAccessible, isDirty, isOperationQueueEnabled, isPutQueueEnabled, isRowUpdatePossible, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, queueOperation, queuedAdditionIterator, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write

Field Details

list

protected List list

Constructor Details

PersistentList

public PersistentList()

PersistentList

public PersistentList(SessionImplementor session)

PersistentList

public PersistentList(SessionImplementor session,
                      List list)

Method Details

add

public boolean add(Object object)
See Also:
java.util.List.add(Object)

add

public void add(int index,
                Object value)
See Also:
java.util.List.add(int, Object)

addAll

public boolean addAll(Collection values)
See Also:
java.util.List.addAll(Collection)

addAll

public boolean addAll(int index,
                      Collection coll)
See Also:
java.util.List.addAll(int, Collection)

beforeInitialize

public void beforeInitialize(CollectionPersister persister,
                             int anticipatedSize)
Specified by:
beforeInitialize in interface PersistentCollection

clear

public void clear()
See Also:
java.util.List.clear()

contains

public boolean contains(Object object)
See Also:
java.util.List.contains(Object)

containsAll

public boolean containsAll(Collection coll)
See Also:
java.util.List.containsAll(Collection)

disassemble

public Serializable disassemble(CollectionPersister persister)
            throws HibernateException
Specified by:
disassemble in interface PersistentCollection

empty

public boolean empty()
Specified by:
empty in interface PersistentCollection
Overrides:
empty in interface AbstractPersistentCollection

entries

public Iterator entries(CollectionPersister persister)
Specified by:
entries in interface PersistentCollection

entryExists

public boolean entryExists(Object entry,
                           int i)
Specified by:
entryExists in interface PersistentCollection

equals

public boolean equals(Object other)

equalsSnapshot

public boolean equalsSnapshot(CollectionPersister persister)
            throws HibernateException
Specified by:
equalsSnapshot in interface PersistentCollection

get

public Object get(int index)
See Also:
java.util.List.get(int)

getDeletes

public Iterator getDeletes(CollectionPersister persister,
                           boolean indexIsFormula)
            throws HibernateException
Specified by:
getDeletes in interface PersistentCollection

getElement

public Object getElement(Object entry)
Specified by:
getElement in interface PersistentCollection

getIndex

public Object getIndex(Object entry,
                       int i,
                       CollectionPersister persister)
Specified by:
getIndex in interface PersistentCollection

getOrphans

public Collection getOrphans(Serializable snapshot,
                             String entityName)
            throws HibernateException
Specified by:
getOrphans in interface PersistentCollection
Overrides:
getOrphans in interface AbstractPersistentCollection

getSnapshot

public Serializable getSnapshot(CollectionPersister persister)
            throws HibernateException
Specified by:
getSnapshot in interface PersistentCollection

getSnapshotElement

public Object getSnapshotElement(Object entry,
                                 int i)
Specified by:
getSnapshotElement in interface PersistentCollection

hashCode

public int hashCode()

indexOf

public int indexOf(Object value)
See Also:
java.util.List.indexOf(Object)

initializeFromCache

public void initializeFromCache(CollectionPersister persister,
                                Serializable disassembled,
                                Object owner)
            throws HibernateException
Specified by:
initializeFromCache in interface PersistentCollection

isEmpty

public boolean isEmpty()
See Also:
java.util.List.isEmpty()

isSnapshotEmpty

public boolean isSnapshotEmpty(Serializable snapshot)
Specified by:
isSnapshotEmpty in interface PersistentCollection

isWrapper

public boolean isWrapper(Object collection)
Specified by:
isWrapper in interface PersistentCollection

iterator

public Iterator iterator()
See Also:
java.util.List.iterator()

lastIndexOf

public int lastIndexOf(Object value)
See Also:
java.util.List.lastIndexOf(Object)

listIterator

public ListIterator listIterator()
See Also:
java.util.List.listIterator()

listIterator

public ListIterator listIterator(int index)
See Also:
java.util.List.listIterator(int)

needsInserting

public boolean needsInserting(Object entry,
                              int i,
                              Type elemType)
            throws HibernateException
Specified by:
needsInserting in interface PersistentCollection

needsUpdating

public boolean needsUpdating(Object entry,
                             int i,
                             Type elemType)
            throws HibernateException
Specified by:
needsUpdating in interface PersistentCollection

readFrom

public Object readFrom(ResultSet rs,
                       CollectionPersister persister,
                       CollectionAliases descriptor,
                       Object owner)
            throws HibernateException,
                   SQLException
Specified by:
readFrom in interface PersistentCollection

remove

public boolean remove(Object value)
See Also:
java.util.List.remove(Object)

remove

public Object remove(int index)
See Also:
java.util.List.remove(int)

removeAll

public boolean removeAll(Collection coll)
See Also:
java.util.List.removeAll(Collection)

retainAll

public boolean retainAll(Collection coll)
See Also:
java.util.List.retainAll(Collection)

set

public Object set(int index,
                  Object value)
See Also:
java.util.List.set(int, Object)

size

public int size()
See Also:
java.util.List.size()

subList

public List subList(int from,
                    int to)
See Also:
java.util.List.subList(int, int)

toArray

public Object[] toArray()
See Also:
java.util.List.toArray()

toArray

public Object[] toArray(Object[] array)
See Also:
java.util.List.toArray(Object[])

toString

public String toString()