|
||||||||||
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>
public abstract class BaseForeignCollection<T,ID>
Base 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).
WARNING: Most likely for(;;) loops should not be used here since we need to be careful about closing the iterator.
Field Summary | |
---|---|
protected Dao<T,ID> |
dao
|
Constructor Summary | |
---|---|
protected |
BaseForeignCollection(Dao<T,ID> dao,
Object parent,
Object parentId,
String columnName,
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. |
protected PreparedQuery<T> |
getPreparedQuery()
|
int |
refresh(T data)
This is a call through to Dao.refresh(Object) using the internal collection DAO. |
abstract boolean |
remove(Object data)
Remove the item from the collection and the associated database table. |
abstract 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 |
update(T data)
This is a call through to Dao.update(Object) using the internal collection DAO. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.j256.ormlite.dao.ForeignCollection |
---|
closeLastIterator, getWrappedIterable, isEager, iteratorThrow, refreshAll, refreshCollection, updateAll |
Methods inherited from interface java.util.Collection |
---|
contains, containsAll, equals, hashCode, isEmpty, iterator, size, toArray, toArray |
Methods inherited from interface com.j256.ormlite.dao.CloseableIterable |
---|
closeableIterator |
Field Detail |
---|
protected final transient Dao<T,ID> dao
Constructor Detail |
---|
protected BaseForeignCollection(Dao<T,ID> dao, Object parent, Object parentId, String columnName, String orderColumn)
Method Detail |
---|
public boolean add(T data)
add
in interface Collection<T>
public boolean addAll(Collection<? extends T> collection)
addAll
in interface Collection<T>
public abstract boolean remove(Object data)
remove
in interface Collection<T>
public abstract boolean removeAll(Collection<?> collection)
removeAll
in interface Collection<T>
public boolean retainAll(Collection<?> collection)
retainAll
in interface Collection<T>
public void clear()
clear
in interface Collection<T>
public int update(T data) throws SQLException
ForeignCollection
Dao.update(Object)
using the internal collection DAO. Objects inside of the
collection are not updated if the parent object is refreshed so you will need to so that by hand.
update
in interface ForeignCollection<T>
SQLException
public int refresh(T data) throws SQLException
ForeignCollection
Dao.refresh(Object)
using the internal collection DAO. Objects inside of the
collection are not refreshed if the parent object is refreshed so you will need to so that by hand.
refresh
in interface ForeignCollection<T>
SQLException
protected PreparedQuery<T> getPreparedQuery() throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |