Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.66 KB | None | 0 0
  1. public abstract class DAOFactory {
  2.     public static final int MYSQL = 1;
  3.     public static final int CASSANDRA = 2;
  4.    
  5.     public abstract EventVariableDAO getEventVariableDAO();
  6.     public abstract SessionVariableDAO getSessionVariableDAO();
  7.     public abstract UserVariableDAO getUserVariableDAO();
  8.     public abstract VisitorDAO getVisitorDAO();
  9.     public abstract VisitDAO getVisitDAO();
  10.     public abstract RequestDAO getRequestDAO();
  11.    
  12.     public static DAOFactory getDAOFactory(int whichFactory) {
  13.         switch (whichFactory) {
  14.             case MYSQL:
  15.                 return new MysqlDAOFactory();
  16.            
  17.             case CASSANDRA:
  18.                 return new CassandraDAOFactory();
  19.            
  20.             default:
  21.                 return null;
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement