站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

List (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.collection
Class List

java.lang.Object
  extended bynet.sf.hibernate.collection.PersistentCollection
      extended bynet.sf.hibernate.collection.ODMGCollection
          extended bynet.sf.hibernate.collection.List
All Implemented Interfaces:
Collection, org.odmg.DArray, org.odmg.DCollection, org.odmg.DList, List, Serializable

public class List
extends ODMGCollection
implements List, org.odmg.DList, org.odmg.DArray

A persistent wrapper for a java.util.List. Underlying collection is an ArrayList.

Author:
Gavin King
See Also:
ArrayList, Serialized Form

Constructor Summary
List()
           
List(SessionImplementor session)
           
List(SessionImplementor session, List list)
           
 
Method Summary
 void add(int index, Object value)
           
 boolean add(Object object)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection coll)
           
 void beforeInitialize(CollectionPersister persister)
          Called before any elements are read into the collection, allowing appropriate initializations to occur.
 void clear()
           
 org.odmg.DList concat(org.odmg.DList arglist)
           
 boolean contains(Object object)
           
 boolean containsAll(Collection coll)
           
 void delayedAddAll(Collection c)
          After reading all existing elements from the database, add the queued elements to the underlying collection.
 Serializable disassemble(CollectionPersister persister)
          Disassemble the collection, ready for the cache
 boolean empty()
          Is the initialized collection empty?
 Iterator entries()
          Iterate all collection entries, during update of the database
 boolean entryExists(Object entry, int i)
          Does an element exist at this entry in the collection?
 boolean equals(Object other)
           
 boolean equalsSnapshot(Type elementType)
          Does the current state exactly match the snapshot?
 Object get(int index)
           
 Iterator getDeletes(Type elemType)
          Get all the elements that need deleting
 Object getIndex(Object entry, int i)
          Get the index of the given collection entry
 Collection getOrphans(Serializable snapshot)
          get all "orphaned" elements
 int hashCode()
           
 int indexOf(Object value)
           
 void initializeFromCache(CollectionPersister persister, Serializable disassembled, Object owner)
          Read the state of the collection from a disassembled cached value
 boolean isEmpty()
           
 boolean isWrapper(Object collection)
          Is this the wrapper for the given underlying collection instance?
 Iterator iterator()
           
 int lastIndexOf(Object value)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 boolean needsInserting(Object entry, int i, Type elemType)
          Do we need to insert this element?
 boolean needsUpdating(Object entry, int i, Type elemType)
          Do we need to update this element?
 Object readFrom(ResultSet rs, CollectionPersister persister, Object owner)
          Read a row from the JDBC result set
 Object remove(int index)
           
 boolean remove(Object value)
           
 boolean removeAll(Collection coll)
           
 void resize(int length)
           
 boolean retainAll(Collection coll)
           
 Object set(int index, Object value)
           
 int size()
           
protected  Serializable snapshot(CollectionPersister persister)
          Return a new snapshot of the current state
 List subList(int from, int to)
           
 Object[] toArray()
           
 Object[] toArray(Object[] array)
           
 String toString()
           
 void writeTo(PreparedStatement st, CollectionPersister persister, Object entry, int i, boolean writeOrder)
          Write a row to the JDBC prepared statement
 
Methods inherited from class net.sf.hibernate.collection.ODMGCollection
existsElement, query, select, selectElement
 
Methods inherited from class net.sf.hibernate.collection.PersistentCollection
afterRowInsert, beginRead, endRead, forceInitialization, getCollectionSnapshot, getOrphans, getSession, getSnapshot, getSnapshot, getValue, hasQueuedAdditions, initialize, isDirectlyAccessible, needsRecreate, postFlush, preInsert, queueAdd, queueAddAll, queuedAdditionIterator, read, setCollectionSnapshot, setCurrentSession, setDirectlyAccessible, setInitialized, unsetSession, wasInitialized, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.odmg.DCollection
existsElement, query, select, selectElement
 

Constructor Detail

List

public List(SessionImplementor session)

List

public List(SessionImplementor session,
            List list)

List

public List()
Method Detail

snapshot

protected Serializable snapshot(CollectionPersister persister)
                         throws HibernateException
Description copied from class: PersistentCollection
Return a new snapshot of the current state

Specified by:
snapshot in class PersistentCollection
Throws:
HibernateException

getOrphans

public Collection getOrphans(Serializable snapshot)
                      throws HibernateException
Description copied from class: PersistentCollection
get all "orphaned" elements

Specified by:
getOrphans in class PersistentCollection
Throws:
HibernateException

equalsSnapshot

public boolean equalsSnapshot(Type elementType)
                       throws HibernateException
Description copied from class: PersistentCollection
Does the current state exactly match the snapshot?

Specified by:
equalsSnapshot in class PersistentCollection
Throws:
HibernateException

beforeInitialize

public void beforeInitialize(CollectionPersister persister)
Description copied from class: PersistentCollection
Called before any elements are read into the collection, allowing appropriate initializations to occur.

Specified by:
beforeInitialize in class PersistentCollection

isWrapper

public boolean isWrapper(Object collection)
Description copied from class: PersistentCollection
Is this the wrapper for the given underlying collection instance?

Specified by:
isWrapper in class PersistentCollection

size

public int size()
Specified by:
size in interface List
See Also:
List.size()

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface List
See Also:
List.isEmpty()

contains

public boolean contains(Object object)
Specified by:
contains in interface List
See Also:
List.contains(Object)

iterator

public Iterator iterator()
Specified by:
iterator in interface List
See Also:
List.iterator()

toArray

public Object[] toArray()
Specified by:
toArray in interface List
See Also:
List.toArray()

toArray

public Object[] toArray(Object[] array)
Specified by:
toArray in interface List
See Also:
List.toArray(Object[])

add

public boolean add(Object object)
Specified by:
add in interface List
See Also:
List.add(Object)

remove

public boolean remove(Object value)
Specified by:
remove in interface List
See Also:
List.remove(Object)

containsAll

public boolean containsAll(Collection coll)
Specified by:
containsAll in interface List
See Also:
List.containsAll(Collection)

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface List
See Also:
List.addAll(Collection)

delayedAddAll

public void delayedAddAll(Collection c)
Description copied from class: PersistentCollection
After reading all existing elements from the database, add the queued elements to the underlying collection.

Overrides:
delayedAddAll in class PersistentCollection

addAll

public boolean addAll(int index,
                      Collection coll)
Specified by:
addAll in interface List
See Also:
List.addAll(int, Collection)

removeAll

public boolean removeAll(Collection coll)
Specified by:
removeAll in interface List
See Also:
List.removeAll(Collection)

retainAll

public boolean retainAll(Collection coll)
Specified by:
retainAll in interface List
See Also:
List.retainAll(Collection)

clear

public void clear()
Specified by:
clear in interface List
See Also:
List.clear()

get

public Object get(int index)
Specified by:
get in interface List
See Also:
List.get(int)

set

public Object set(int index,
                  Object value)
Specified by:
set in interface List
See Also:
List.set(int, Object)

add

public void add(int index,
                Object value)
Specified by:
add in interface List
See Also:
List.add(int, Object)

remove

public Object remove(int index)
Specified by:
remove in interface List
See Also:
List.remove(int)

indexOf

public int indexOf(Object value)
Specified by:
indexOf in interface List
See Also:
List.indexOf(Object)

lastIndexOf

public int lastIndexOf(Object value)
Specified by:
lastIndexOf in interface List
See Also:
List.lastIndexOf(Object)

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List
See Also:
List.listIterator()

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List
See Also:
List.listIterator(int)

subList

public List subList(int from,
                    int to)
Specified by:
subList in interface List
See Also:
List.subList(int, int)

empty

public boolean empty()
Description copied from class: PersistentCollection
Is the initialized collection empty?

Specified by:
empty in class PersistentCollection

toString

public String toString()

writeTo

public void writeTo(PreparedStatement st,
                    CollectionPersister persister,
                    Object entry,
                    int i,
                    boolean writeOrder)
             throws HibernateException,
                    SQLException
Description copied from class: PersistentCollection
Write a row to the JDBC prepared statement

Specified by:
writeTo in class PersistentCollection
Throws:
HibernateException
SQLException
See Also:
PersistentCollection.writeTo(PreparedStatement, CollectionPersister, Object, int, boolean)

readFrom

public Object readFrom(ResultSet rs,
                       CollectionPersister persister,
                       Object owner)
                throws HibernateException,
                       SQLException
Description copied from class: PersistentCollection
Read a row from the JDBC result set

Specified by:
readFrom in class PersistentCollection
Throws:
HibernateException
SQLException
See Also:
PersistentCollection.readFrom(ResultSet, CollectionPersister, Object)

entries

public Iterator entries()
Description copied from class: PersistentCollection
Iterate all collection entries, during update of the database

Specified by:
entries in class PersistentCollection
See Also:
PersistentCollection.entries()

initializeFromCache

public void initializeFromCache(CollectionPersister persister,
                                Serializable disassembled,
                                Object owner)
                         throws HibernateException
Description copied from class: PersistentCollection
Read the state of the collection from a disassembled cached value

Specified by:
initializeFromCache in class PersistentCollection
Throws:
HibernateException

disassemble

public Serializable disassemble(CollectionPersister persister)
                         throws HibernateException
Description copied from class: PersistentCollection
Disassemble the collection, ready for the cache

Specified by:
disassemble in class PersistentCollection
Throws:
HibernateException

getDeletes

public Iterator getDeletes(Type elemType)
                    throws HibernateException
Description copied from class: PersistentCollection
Get all the elements that need deleting

Specified by:
getDeletes in class PersistentCollection
Throws:
HibernateException

needsInserting

public boolean needsInserting(Object entry,
                              int i,
                              Type elemType)
                       throws HibernateException
Description copied from class: PersistentCollection
Do we need to insert this element?

Specified by:
needsInserting in class PersistentCollection
Throws:
HibernateException

needsUpdating

public boolean needsUpdating(Object entry,
                             int i,
                             Type elemType)
                      throws HibernateException
Description copied from class: PersistentCollection
Do we need to update this element?

Specified by:
needsUpdating in class PersistentCollection
Throws:
HibernateException

getIndex

public Object getIndex(Object entry,
                       int i)
Description copied from class: PersistentCollection
Get the index of the given collection entry

Specified by:
getIndex in class PersistentCollection
See Also:
PersistentCollection.getIndex(Object, int)

concat

public org.odmg.DList concat(org.odmg.DList arglist)
Specified by:
concat in interface org.odmg.DList
See Also:
DList.concat(DList)

resize

public void resize(int length)
Specified by:
resize in interface org.odmg.DArray
See Also:
DArray.resize(int)

equals

public boolean equals(Object other)
Specified by:
equals in interface List

hashCode

public int hashCode()
Specified by:
hashCode in interface List

entryExists

public boolean entryExists(Object entry,
                           int i)
Description copied from class: PersistentCollection
Does an element exist at this entry in the collection?

Specified by:
entryExists in class PersistentCollection
See Also:
PersistentCollection.entryExists(java.lang.Object, int)