There is already a @pageActivationContext that does this. It only works for simple properties though http://tapestry.apache.org/tapestry5/tapestry-hibernate/userguide.html
On Mon, Mar 29, 2010 at 10:50 PM, Michael Prescott < michael.r.presc...@gmail.com> wrote: > Hey, it would be really nice if I could skip all the writing of > onActivate() > and onPassivate() methods, just using an annotation like this: > > @Persist("activationContext") > public String someUsefulIdentifier; > > Or, perhaps (and more useful for my case, when I want a domain entity > handy): > > @ActivationContext(0) > public String getIdOfDomainEntityIAmEditing() { > return this.domainEntity.getId(); > } > > public void setIdOfDomainEntityIAmEditing( String id ) { > this.domainEntity = myInjectedDao.load(id); > } > > @ActivationContext(1) > private boolean editMode; > > The integer parameter is there to make the serialization order unambiguous, > so that you can compose URLs to the page. > > I'm just making this stuff up. > > Whaddya think? > > Michael >