|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.j256.ormlite.dao.BaseForeignCollection<T,ID>
com.j256.ormlite.dao.EagerForeignCollection<T,ID>
public class EagerForeignCollection<T,ID>
Collection that is set on a field that as been marked with the ForeignCollectionField annotation when an
object is refreshed or queried (i.e. not created).
| Field Summary |
|---|
| Fields inherited from class com.j256.ormlite.dao.BaseForeignCollection |
|---|
dao |
| Constructor Summary | |
|---|---|
EagerForeignCollection(Dao<T,ID> dao,
Object parent,
FieldType foreignFieldType,
Object fieldValue,
String orderColumn)
|
|
| Method Summary | ||
|---|---|---|
boolean |
add(T data)
Add an element to the collection. |
|
boolean |
addAll(Collection<? extends T> collection)
Add the collection of elements to this collection. |
|
void |
clear()
Clears the collection and uses the iterator to run through the dao and delete all of the items in the collection from the associated database table. |
|
void |
close()
This will close the last iterator returned by the Iterable.iterator() method. |
|
CloseableIterator<T> |
closeableIterator()
Returns an iterator over a set of elements of type T which can be closed. |
|
void |
closeLastIterator()
This will close the last iterator returned by the Collection.iterator() method. |
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
boolean |
equals(Object other)
This is just a call to the equals method of the internal results list. |
|
CloseableWrappedIterable<T> |
getWrappedIterable()
This makes a one time use iterable class that can be closed afterwards. |
|
int |
hashCode()
This is just a call to the hashcode method of the internal results list. |
|
boolean |
isEager()
Returns true if this an eager collection otherwise false. |
|
boolean |
isEmpty()
|
|
CloseableIterator<T> |
iterator()
|
|
CloseableIterator<T> |
iteratorThrow()
Like Collection.iterator() but returns a closeable iterator instead and can throw a SQLException. |
|
boolean |
remove(Object data)
Remove the item from the collection and the associated database table. |
|
boolean |
removeAll(Collection<?> collection)
Remove the items in the collection argument from the foreign collection and the associated database table. |
|
boolean |
retainAll(Collection<?> collection)
Uses the iterator to run through the dao and retain only the items that are in the passed in collection. |
|
int |
size()
|
|
Object[] |
toArray()
|
|
|
toArray(E[] array)
|
|
| Methods inherited from class com.j256.ormlite.dao.BaseForeignCollection |
|---|
getPreparedQuery |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EagerForeignCollection(Dao<T,ID> dao,
Object parent,
FieldType foreignFieldType,
Object fieldValue,
String orderColumn)
throws SQLException
SQLException| Method Detail |
|---|
public CloseableIterator<T> iterator()
iterator in interface Iterable<T>iterator in interface Collection<T>public CloseableIterator<T> closeableIterator()
CloseableIterable
closeableIterator in interface CloseableIterable<T>public CloseableIterator<T> iteratorThrow()
ForeignCollectionCollection.iterator() but returns a closeable iterator instead and can throw a SQLException.
iteratorThrow in interface ForeignCollection<T>public CloseableWrappedIterable<T> getWrappedIterable()
ForeignCollectionCloseableWrappedIterable but multiple threads can each call this to get their own closeable iterable.
getWrappedIterable in interface ForeignCollection<T>public void close()
CloseableWrappedIterableIterable.iterator() method.
close in interface CloseableWrappedIterable<T>public void closeLastIterator()
ForeignCollectionCollection.iterator() method.
NOTE: For lazy collections, this is not reentrant. If multiple threads are getting iterators from a lazy
collection from the same object then you should use ForeignCollection.getWrappedIterable() to get a reentrant wrapped
iterable for each thread instead.
closeLastIterator in interface ForeignCollection<T>public boolean isEager()
ForeignCollection
isEager in interface ForeignCollection<T>public int size()
size in interface Collection<T>public boolean isEmpty()
isEmpty in interface Collection<T>public boolean contains(Object o)
contains in interface Collection<T>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<T>public Object[] toArray()
toArray in interface Collection<T>public <E> E[] toArray(E[] array)
toArray in interface Collection<T>public boolean add(T data)
BaseForeignCollection
add in interface Collection<T>add in class BaseForeignCollection<T,ID>public boolean addAll(Collection<? extends T> collection)
BaseForeignCollection
addAll in interface Collection<T>addAll in class BaseForeignCollection<T,ID>public boolean remove(Object data)
BaseForeignCollection
remove in interface Collection<T>remove in class BaseForeignCollection<T,ID>public boolean removeAll(Collection<?> collection)
BaseForeignCollection
removeAll in interface Collection<T>removeAll in class BaseForeignCollection<T,ID>public boolean retainAll(Collection<?> collection)
BaseForeignCollection
retainAll in interface Collection<T>retainAll in class BaseForeignCollection<T,ID>public void clear()
BaseForeignCollection
clear in interface Collection<T>clear in class BaseForeignCollection<T,ID>public boolean equals(Object other)
equals in interface Collection<T>equals in class Objectpublic int hashCode()
hashCode in interface Collection<T>hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||