|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ojb.broker.accesslayer.CollectionProxy
CollectionProxy.
A placeHolder for a whole collection to support deferred loading of relationships.
The complete relationship is loaded on request.
Constructor Summary | |
CollectionProxy(java.lang.Class aCollClass,
PersistenceBroker aBroker,
Query aQuery)
|
|
CollectionProxy(PersistenceBroker aBroker,
Query aQuery)
|
Method Summary | |
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
protected void |
calculateSize()
do a count(*) with the query |
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
protected PersistenceBroker |
getBroker()
Gets the broker. |
protected java.lang.Class |
getCollectionClass()
Gets the collectionClass. |
protected java.util.Collection |
getData()
Gets the data, load it if not already done. |
protected Query |
getQuery()
Gets the query. |
boolean |
isEmpty()
|
protected boolean |
isLoaded()
|
java.util.Iterator |
iterator()
|
protected void |
load()
loads the data from the database, if count(*) returned > 0 |
void |
ojbAdd(java.lang.Object anObject)
add a single Object to the Collection. |
void |
ojbAddAll(ManageableCollection otherCollection)
adds a Collection to this collection. |
java.util.Iterator |
ojbIterator()
returns an Iterator over all elements in the collection. |
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
protected void |
setBroker(PersistenceBroker broker)
Sets the broker. |
protected void |
setCollectionClass(java.lang.Class collectionClass)
Sets the collectionClass. |
protected void |
setData(java.util.Collection data)
Sets the data. |
protected void |
setQuery(Query query)
Sets the query. |
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Constructor Detail |
public CollectionProxy(PersistenceBroker aBroker, Query aQuery)
public CollectionProxy(java.lang.Class aCollClass, PersistenceBroker aBroker, Query aQuery)
Method Detail |
protected boolean isLoaded()
protected void calculateSize()
protected void load() throws PersistenceBrokerException
PersistenceBrokerException
public int size()
size
in interface java.util.Collection
public boolean isEmpty()
isEmpty
in interface java.util.Collection
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
public java.util.Iterator iterator()
iterator
in interface java.util.Collection
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
public void clear()
clear
in interface java.util.Collection
protected Query getQuery()
protected void setQuery(Query query)
query
- The query to setprotected PersistenceBroker getBroker()
protected void setBroker(PersistenceBroker broker)
broker
- The broker to setprotected java.util.Collection getData()
protected void setData(java.util.Collection data)
data
- The data to setprotected java.lang.Class getCollectionClass()
protected void setCollectionClass(java.lang.Class collectionClass)
collectionClass
- The collectionClass to setpublic void ojbAdd(java.lang.Object anObject)
ManageableCollection
ojbAdd
in interface ManageableCollection
public void ojbAddAll(ManageableCollection otherCollection)
ManageableCollection
ojbAddAll
in interface ManageableCollection
public java.util.Iterator ojbIterator()
ManageableCollection
ojbIterator
in interface ManageableCollection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |