|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.accesslayer.CollectionProxy
CollectionProxy.
A placeHolder for a whole collection to support deferred loading of relationships.
The complete relationship is loaded on request.
Field Summary |
Fields inherited from interface org.apache.ojb.broker.ManageableCollection |
serialVersionUID |
Constructor Summary | |
CollectionProxy(PBKey aKey,
java.lang.Class aCollClass,
Query aQuery)
|
|
CollectionProxy(PBKey aKey,
Query aQuery)
|
Method Summary | |
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
void |
addListener(CollectionProxyListener l)
|
protected void |
afterLoading()
|
void |
afterStore(PersistenceBroker broker)
A callback method to implement 'removal-aware' (track removed objects and delete them by its own) collection implementations. |
protected void |
beforeLoading()
|
void |
clear()
Clear the proxy. |
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
protected PersistenceBroker |
getBroker()
Gets the broker. |
protected PBKey |
getBrokerKey()
Returns the brokerKey. |
protected java.lang.Class |
getCollectionClass()
Gets the collectionClass. |
java.util.Collection |
getData()
Gets the data, load it if not already done. |
protected Query |
getQuery()
Gets the query. |
boolean |
isEmpty()
|
boolean |
isLoaded()
|
java.util.Iterator |
iterator()
|
protected java.util.Collection |
loadData()
loads the data from the database, if count(*) returned > 0 |
protected void |
loadSize()
do a count(*) with the query |
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. |
protected void |
releaseBroker()
release the PersistenceBroker |
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
void |
removeListener(CollectionProxyListener l)
|
boolean |
retainAll(java.util.Collection c)
|
protected void |
setBrokerKey(PBKey brokerKey)
Sets the brokerKey. |
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(PBKey aKey, Query aQuery)
public CollectionProxy(PBKey aKey, java.lang.Class aCollClass, Query aQuery)
Method Detail |
public boolean isLoaded()
protected void loadSize() throws PersistenceBrokerException
PersistenceBrokerException
protected java.util.Collection loadData() throws PersistenceBrokerException
PersistenceBrokerException
protected void beforeLoading()
protected void afterLoading()
public int size()
size
in interface java.util.Collection
Collection.size()
public boolean isEmpty()
isEmpty
in interface java.util.Collection
Collection.isEmpty()
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
Collection.contains(Object)
public java.util.Iterator iterator()
iterator
in interface java.util.Collection
Collection.iterator()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
Collection.toArray()
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
Collection.toArray(Object[])
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
Collection.add(Object)
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
Collection.remove(Object)
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
Collection.containsAll(Collection)
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
Collection.addAll(Collection)
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
Collection.removeAll(Collection)
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
Collection.retainAll(Collection)
public void clear()
clear
in interface java.util.Collection
Collection.clear()
protected Query getQuery()
protected void setQuery(Query query)
query
- The query to setprotected void releaseBroker()
protected PersistenceBroker getBroker() throws PBFactoryException
PBFactoryException
public 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
ManageableCollection.ojbAdd(Object)
public void ojbAddAll(ManageableCollection otherCollection)
ManageableCollection
ojbAddAll
in interface ManageableCollection
ManageableCollection.ojbAddAll(ManageableCollection)
public java.util.Iterator ojbIterator()
ManageableCollection
ojbIterator
in interface ManageableCollection
ManageableCollection.ojbIterator()
public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
ManageableCollection
afterStore
in interface ManageableCollection
PersistenceBrokerException
ManageableCollection.afterStore(PersistenceBroker broker)
protected PBKey getBrokerKey()
protected void setBrokerKey(PBKey brokerKey)
brokerKey
- The brokerKey to setpublic void addListener(CollectionProxyListener l)
public void removeListener(CollectionProxyListener l)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |