Hi,
I have tested 3 persistence implementations (Jdbc, Ibatis and JPA).
All is fine, but now i want to inject a given implementation with
Guice. How can I do this ? I see your previous posts, but not
understand all. Thanks for help.
package dao;
import dao.jdbc.JdbcDAOFactory;
import dao.ibatis.IbatisDAOFactory;
import dao.jpa.JpaDAOFactory;
public abstract class DAOFactory {
// public static final Class FACTORY_CLASS = JdbcDAOFactory.class;
// public static final Class FACTORY_CLASS = IbatisDAOFactory.class;
public static final Class FACTORY_CLASS = JpaDAOFactory.class;
public static DAOFactory getFactory() {
try {
return (DAOFactory) FACTORY_CLASS.newInstance();
} catch (Exception ex) {
throw new RuntimeException("Problem in factory building");
}
}
public abstract IConnectionManager getConnectionManager();
public abstract IEtudiantManager getEtudiantManager();
public abstract IOptionManager getOptionManager();
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---