You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sven Homburg <ho...@googlemail.com> on 2008/03/10 14:40:02 UTC

[T5] best practice to add hibernate interceptor

hi there,

has anybody an idea, how to add an interceptor
to a "tapestry initialized" hibernate session ?

-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: [T5] best practice to add hibernate interceptor

Posted by Sven Homburg <ho...@googlemail.com>.
thanx, that was the kick i needed

2008/3/10, Chris Lewis <bu...@gmail.com>:
>
> Indeed, but you asked how to add an interceptor to a
> tapestry-initialized session, and the answer to that is there :-).
> If I understand your other question, you want to access user-specific
> (and therefore probably request-specific) details from the interceptor.
> There are to overall ways to do this:
>
> 1) have the entity provide it (or provide access to it), or
> 2) inject something into your interceptor that can provide it
>
> I think #2 would probably be the best way to go. If it's
> request-specific domain objects you're after, inject the
> ApplicationStateManger and grab what you need from it. If you want to
> provide a more general-purpose interceptor that doesn't rely on specific
> state objects, inject one of the standard servlet interfaces (Request,
> etc) that can give you what you need.
>
> Hope that helps.
>
>
> chris
>
> Sven Homburg wrote:
> > hi chris,
> >
> > nice sample, but if i want to add the user name/ip number to a field
> like
> > "createdBy"
> > there is no known simple way to fill that field.
> >
> > 2008/3/10, Chris Lewis <bu...@gmail.com>:
> >
> >> Hi Sven,
> >>
> >> I did this in a wiki:
> >> http://wiki.apache.org/tapestry/Tapestry5BrainlessEntityTimestamping.
> >>
> >> The second half of it shows how to do this.
> >>
> >> chris
> >>
> >>
> >> Sven Homburg wrote:
> >>
> >>> hi there,
> >>>
> >>> has anybody an idea, how to add an interceptor
> >>> to a "tapestry initialized" hibernate session ?
> >>>
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >>
> >
> >
> >
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: [T5] best practice to add hibernate interceptor

Posted by Chris Lewis <bu...@gmail.com>.
Indeed, but you asked how to add an interceptor to a
tapestry-initialized session, and the answer to that is there :-).
If I understand your other question, you want to access user-specific
(and therefore probably request-specific) details from the interceptor.
There are to overall ways to do this:

1) have the entity provide it (or provide access to it), or
2) inject something into your interceptor that can provide it

I think #2 would probably be the best way to go. If it's
request-specific domain objects you're after, inject the
ApplicationStateManger and grab what you need from it. If you want to
provide a more general-purpose interceptor that doesn't rely on specific
state objects, inject one of the standard servlet interfaces (Request,
etc) that can give you what you need.

Hope that helps.

chris

Sven Homburg wrote:
> hi chris,
>
> nice sample, but if i want to add the user name/ip number to a field like
> "createdBy"
> there is no known simple way to fill that field.
>
> 2008/3/10, Chris Lewis <bu...@gmail.com>:
>   
>> Hi Sven,
>>
>> I did this in a wiki:
>> http://wiki.apache.org/tapestry/Tapestry5BrainlessEntityTimestamping.
>>
>> The second half of it shows how to do this.
>>
>> chris
>>
>>
>> Sven Homburg wrote:
>>     
>>> hi there,
>>>
>>> has anybody an idea, how to add an interceptor
>>> to a "tapestry initialized" hibernate session ?
>>>
>>>
>>>       
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>     
>
>
>   


Re: [T5] best practice to add hibernate interceptor

Posted by Sven Homburg <ho...@googlemail.com>.
hi chris,

nice sample, but if i want to add the user name/ip number to a field like
"createdBy"
there is no known simple way to fill that field.

2008/3/10, Chris Lewis <bu...@gmail.com>:
>
> Hi Sven,
>
> I did this in a wiki:
> http://wiki.apache.org/tapestry/Tapestry5BrainlessEntityTimestamping.
>
> The second half of it shows how to do this.
>
> chris
>
>
> Sven Homburg wrote:
> > hi there,
> >
> > has anybody an idea, how to add an interceptor
> > to a "tapestry initialized" hibernate session ?
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: [T5] best practice to add hibernate interceptor

Posted by Chris Lewis <bu...@gmail.com>.
Hi Sven,

I did this in a wiki:
http://wiki.apache.org/tapestry/Tapestry5BrainlessEntityTimestamping.

The second half of it shows how to do this.

chris

Sven Homburg wrote:
> hi there,
>
> has anybody an idea, how to add an interceptor
> to a "tapestry initialized" hibernate session ?
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org