|
Demonstration of different ways to use Hibernate to represent your domain
model as a series of JDK dynamic proxies. We map the interfaces and then
use one of two approaches to get Hibernate to recognize these proxies as
domain entities. Really this is demonstrating various "entity representation"
capabilities built in to Hibernate3.
First we use an interceptor-based approach where we use a custom Interceptor
implementation for interpret incoming proxies (and resolve them to the correct
mappings) and to help Hibernate instantiate these proxy instances. This is the
quick-and-dirty approach. It is fully expected that this approach will
encounter certain limitations.
Next we explore the notion of a Tuplizer and plug in custom Tuplizers to
help achieve the same results. Currently, Tuplizers do not have a chance
to influence the resolution of entity-name given a potential entity, so we
also use an Interceptor here and supply its getEntityName() impl. This is
simply so we do not need to supply the entity name explicitly to the
Hibernate Session calls.
|