Quantcast

How to inject SQLSessionFactory with SQLSessionFactoryProvider

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

How to inject SQLSessionFactory with SQLSessionFactoryProvider

Zenon
I wonder how to do this in the simplest way, I've looked around the
web but I've not found an example for a web app using mybatis guice.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to inject SQLSessionFactory with SQLSessionFactoryProvider

Eduardo Macarron
Zenon, when using Guice you can directly inject an SqlSession or a
Mapper, what do you want to inject a factory for?

On 2 abr, 15:31, Zenon <[hidden email]> wrote:
> I wonder how to do this in the simplest way, I've looked around the
> web but I've not found an example for a web app using mybatis guice.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to inject SQLSessionFactory with SQLSessionFactoryProvider

Zenon
Yes I could but I prefer to inject only the SqlSessionFactory.

Anyway I didn't found any complete example of a webapp with a servlet calling these objects with DI...

Il giorno lunedì 2 aprile 2012 17:35:50 UTC+2, Eduardo ha scritto:
Zenon, when using Guice you can directly inject an SqlSession or a
Mapper, what do you want to inject a factory for?

On 2 abr, 15:31, Zenon <[hidden email]> wrote:
> I wonder how to do this in the simplest way, I've looked around the
> web but I've not found an example for a web app using mybatis guice.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: How to inject SQLSessionFactory with SQLSessionFactoryProvider

Josh Kamau

Create a guice provider that returns an sql factory

On 3 Apr 2012 17:35, "Fabrizio Starred" <[hidden email]> wrote:

Yes I could but I prefer to inject only the SqlSessionFactory.

Anyway I didn't found any complete example of a webapp with a servlet calling these objects with DI...

Il giorno lunedì 2 aprile 2012 17:35:50 UTC+2, Eduardo ha scritto:


>
> Zenon, when using Guice you can directly inject an SqlSession or a
> Mapper, what do you want ...

Loading...