- All Implemented Interfaces:
- Enclosing interface:
public abstract static class ObjectAccessEventHandler.LazyCollectionEventHandler
- extends ObjectAccessEventHandler.LazyLoadAccessEventHandler
protected static java.util.Collection
This method is needed to resolve the obscure, but tricky relationship between autoload
references and lazy loading.
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.lang.String m_dsName
protected java.lang.String m_forAttributes
protected static java.util.Map<HydrateObject,java.util.Map<java.lang.String,java.util.Collection>> m_collections
protected ObjectAccessEventHandler.LazyCollectionEventHandler(java.lang.String dsName,
public java.util.Collection getWeakCollection(HydrateObject obj,
- Description copied from interface:
- This method is needed to resolve the obscure, but tricky relationship between autoload
references and lazy loading. Our problem is that on loading objects we often implicitly
fix up back references to unloaded collections. However, this gets in the way of the lazy
loading of collections because either the collection will try and load when the back
reference is created, or it will block subsequent implicit loading of the full
collection afterwards. The solution is to permit weakly referenced collections that
are not part of the class until explicity created but can keep track of these back
references in the meantime. This method requests the creation (or resolution) of such
a weakly referenced collection. These collections should always disappear as soon as
the object they belong to is eligible for garbage collection
- Specified by:
getWeakCollection in interface
getWeakCollection in class
obj - the hydrate object that needs a collection. Don't even start thinking about
getting this to work with non-Hydrate objects.
attr - the name of the attribute (must be the static reference from the interface)
collClass - the class of the collection that would be created if there is none
- this method should return null if it doesn't implement collectionNotLoaded i.e.
doesn't concern itself with lazy loading of collections. If it does, it must return a
collection that 'belongs' to the given object. In other words, subsequent calls to this
method must return the same collection, but that collection must be eligible for garbage
collection when the object reference goes out of scope.
protected static java.util.Collection getCollection(HydrateObject obj,
Copyright © 2000 The Hydrate Project. All Rights Reserved.