Using MyBatisModule (Guice)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using MyBatisModule (Guice)

Asaf Mesika
Hi,

I've followed the quick start guide to use Guice MyBatisModule.
I discovered I had to add the following lines, otherwise it doesn't work. Any idea why?


bind(JdbcTransactionFactory.class);
bindTransactionFactoryType
(JdbcTransactionFactory.class);
bind
(SqlSessionManagerProvider.class);
bind
(EnvironmentProvider.class);
bind
(ConfigurationProvider.class);
bind
(SqlSessionFactoryProvider.class);
bind
(DefaultObjectFactory.class);
bind
(DefaultObjectWrapperFactory.class);


Thanks!

Asaf Mesika
Logz.io

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Using MyBatisModule (Guice)

Jeff Butler
It is typical to call bindTransactionFactoryType() and bindDataSourceProviderType().  I've never had to do the others you mentioned.

Jeff Butler
 

On Wed, Jun 22, 2016 at 4:41 AM Asaf Mesika <[hidden email]> wrote:
Hi,

I've followed the quick start guide to use Guice MyBatisModule.
I discovered I had to add the following lines, otherwise it doesn't work. Any idea why?


bind(JdbcTransactionFactory.class);
bindTransactionFactoryType
(JdbcTransactionFactory.class);
bind
(SqlSessionManagerProvider.class);
bind
(EnvironmentProvider.class);
bind
(ConfigurationProvider.class);
bind
(SqlSessionFactoryProvider.class);
bind
(DefaultObjectFactory.class);
bind
(DefaultObjectWrapperFactory.class);


Thanks!

Asaf Mesika
Logz.io

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.