Hi,

I've wondered the same thing and taken a quick look at it. I'm pretty
sure that it can be done, but the big issue is how to identify what the
activation context's value means to the entity? With a PK it's easy to
make assumptions (cast the context value and if it can be cast to a long
and the context argument type is a known hibernate entity, load it from
the ORM). Anyway, take a look at the tapestry-hibernate source and pay
close attention to the PK-based ValueEncoders - because you'll need to
create a new one - and also to how it registers them with hibernate
entities.

good luck and please share any troubles/victories

chris

Angelo Chen wrote:
> Hi,
>
> I like the feature that we can now pass Hibernate entity to the onActivate
> and T5 automatically picks up object from database. however it assumes what
> passed is the primary key, example:
>
> 1. this works.
> localhost://page/1
>
> 2. this will not work:
> localhost://page/myName
>
> is there a way to tell T5 that to use a particular field to pick up the
> object?
>
> thanks,
>
> sample code follows:
>
> public class Page 
> { 
>   private Person person; 
>
>   void onActivate(Person person) 
>   { 
>     this.person = person; 
>   } 
>
>   Object onPassivate() 
>   { 
>       return this.person; 
>   } 
> }
>
>
>   

-- 
http://thegodcode.net


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to