|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ForeignCollection<T>
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).
@ForeignCollectionField(eager = false) private ForeignCollection<Order> orders;
NOTE: If the collection has been marked as being "lazy" then just about all methods in this class result in a
pass through the database using the iterator()
. Even Collection.size()
and other seemingly simple calls can
cause a lot of database I/O. Most likely just the iterator()
, Collection.toArray()
, and
Collection.toArray(Object[])
methods should be used if you are using a lazy collection.
Method Summary | |
---|---|
CloseableIterator<T> |
iterator()
Like Collection.iterator() but returns a closeable iterator instead. |
CloseableIterator<T> |
iteratorThrow()
Like Collection.iterator() but returns a closeable iterator instead and can throw a SQLException. |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray |
Method Detail |
---|
CloseableIterator<T> iterator()
Collection.iterator()
but returns a closeable iterator instead. This may throw
RuntimeException
if there is any SQL exceptions unfortunately.
iterator
in interface Collection<T>
iterator
in interface Iterable<T>
CloseableIterator<T> iteratorThrow() throws SQLException
Collection.iterator()
but returns a closeable iterator instead and can throw a SQLException.
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |