|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl
A place holder for a whole collection to support deferred loading of relationships. The complete collection is loaded on access to the data.
Field Summary |
Fields inherited from interface org.apache.ojb.broker.ManageableCollection |
serialVersionUID |
Constructor Summary | |
CollectionProxyDefaultImpl(PBKey brokerKey,
java.lang.Class collClass,
Query query)
Creates a new collection proxy that uses the given collection type. |
|
CollectionProxyDefaultImpl(PBKey brokerKey,
Query query)
Creates a new collection proxy (uses RemovalAwareCollection
as the collection class). |
Method Summary | |
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
void |
addListener(CollectionProxyListener listener)
Adds a listener to this collection. |
void |
afterStore(PersistenceBroker broker)
A callback method to implement 'removal-aware' (track removed objects and delete them by its own) collection implementations. |
void |
clear()
Clears the proxy. |
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
PBKey |
getBrokerKey()
Returns the key of the persistence broker used by this collection. |
java.lang.Class |
getCollectionClass()
Returns the collection type. |
java.util.Collection |
getData()
Returns the collection data, load it if not already done so. |
Query |
getQuery()
Returns the defining query. |
boolean |
isEmpty()
|
boolean |
isLoaded()
Determines whether the collection data already has been loaded from the database. |
java.util.Iterator |
iterator()
|
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)
|
void |
removeListener(CollectionProxyListener listener)
Removes the given listener from this collecton. |
boolean |
retainAll(java.util.Collection c)
|
void |
setData(java.util.Collection data)
Sets the collection data. |
void |
setProfileKey(java.lang.Object profileKey)
Sets the metadata profile key used when creating this proxy. |
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Constructor Detail |
public CollectionProxyDefaultImpl(PBKey brokerKey, Query query)
RemovalAwareCollection
as the collection class).
brokerKey
- The key of the persistence brokerquery
- The defining querypublic CollectionProxyDefaultImpl(PBKey brokerKey, java.lang.Class collClass, Query query)
brokerKey
- The key of the persistence brokercollClass
- The collection typequery
- The defining queryMethod Detail |
public boolean isLoaded()
isLoaded
in interface CollectionProxy
true
if the data is already loadedpublic 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()
public Query getQuery()
public java.util.Collection getData()
public void setData(java.util.Collection data)
data
- The datapublic java.lang.Class getCollectionClass()
public 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)
public PBKey getBrokerKey()
public void setProfileKey(java.lang.Object profileKey)
profileKey
- the metadata profile keypublic void addListener(CollectionProxyListener listener)
addListener
in interface CollectionProxy
listener
- The listener to addpublic void removeListener(CollectionProxyListener listener)
removeListener
in interface CollectionProxy
listener
- The listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |