Angelo,
Thanks Angelo. What my service needs is an access control list stored in
a database, but it doesn't actually need to query the database as long
as it can be passed the list (as some kind of object). So I think what I
need is to use @Session in my AppModule, query in my builder method, and
then pass the list to the service (constructor injection). Would that
seem like a sane way? I ask because I'm just getting started on
tapestry-hibernate and am not sure if this is considered good or bad
practice. It seems perfectly sane to me, but opinions are most welcome.
I also wanted to reiterate the concern lasitha brought up about
injecting the Session into a service, as you mentioned. See the previous
messages for them, but you may experience issues using it like that.
thanks for any input!
Angelo Chen wrote:
Hi Chris,
If what you want is, accessing the hibernate session from your service,
Davor has answer to my similar question before:
declare Session as parameter in you service constructor
you dont even need to call any inject annotation ...
MyServiceImpl(Session session){
this.session=session;
}
in your module use:
public static void bind(ServiceBinder binder)
{
binder.bind(MyService.class, MyServiceImpl.class);
}
It works very well.
A.C.
Chris Lewis-5 wrote:
Hi all,
So my question is, how should I go about getting access to my database
from my service? I'd like to use the blinding simplicity of of IoC just
giving it to me, but I;m not sure that's an option. Any ideas?
thanks,
chris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]