Subject: Non-cached view models


I want to use view models as a wrapper around a persisted domain entity to
simply present an alternative view of that entity. The idea of caching such
a view model doesn't make sense to me, rather I want the persisted domain
entity to be cached and the view model (representation of it) to be
recreated each time that its needed, probably by having a constructor that
includes the domain entity as a parameter.

I can create a DomainObject with nature = Nature.INMEMORY_ENTITY, and make
it non bookmarkable, how the title is still a link to a now cached entity
that cannot be recreated.

Stack trace:

   - org.apache.wicket.WicketRuntimeException
   - Can't instantiate page using constructor 'public
   and argument
   An exception has been thrown during construction!
   - org.apache.wicket.session.DefaultPageFactory#newPage(
I can see a way to do what I want by creating a persistent domain entity
that references the persistent domain entity of interest, and then just has
getters that refer to the equivalent getter of the domain entity of

This need has been created my desire to have a very simple view of a domain
entity without using tabs in the layout.xml and the admin view that does
use layout.xml, but I suspect its a more general need.