| An "automated" implementation of BeanLocator, useful for managing "entities",
addressed by a unique ID convertible to String, which are already provided with
some form of (probably application-scope) "DAO"-type API. This implementation
allows the DAO API to be expressed by means of EL method bindings to its
various methods, from which the managed entities are mapped into this
this request-scope cache.
Typically the user will provide a fetchMethod which will fetch
entities by ID, and (at least one of) a newMethod or an
entityClass which is used to instantiate new entities which
are not persistent. At any time, the "cache" of currently addressed
entities within this request may be accessed through the map
deliveredBeans
If the saveEL is also
supplied, this locator will also implement a saveAll() method
which will return all the delivered entities back to persistence. If this is
not supplied, they are assumed to be persisted by some other means (perhaps
an auto-commit of some kind).
author: Antranig Basman (antranig@caret.cam.ac.uk) |