On Fri, Sep 2, 2011 at 1:55 AM, Howard Lewis Ship <[email protected]> wrote:

> I'm helping a client build a CRUD app on top of tapestry-hibernate
>
> His pattern is to use the same exact page for edit and create pages
>
> The problem he's getting is this:
>
>  @PageActivationContext
>  private MyEntity myEntity;
>
>  void onActivate() { if (myEntity == null) { myEntity = new MyEntity(); } }
>
> This works fine for editing of existing entities, but the creation
> fails ... tapestry-hibernate's ValueEncoder attempts to encode the
> transient instance and gets a failure because there's no persistent id
> until it is made persistent.
>
> I'd like to change the support to handle this case by returning a null
> or empty page activation context when the object to be encoded is null
> or transient.
>
> This is a quasi-backwards-compatible change ... it will enable a
> behavior that, in prior releases, would be a runtime exception.
>
> Thoughts?

I've always managed my entity objects myself cause transient instances
are a nightmare... everything which can help in that area is welcome.

Cheers
-- 
Massimo
http://meridio.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to