Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see de.xwic.appkit.core.IDAOFactoryAdmin#registerQuery(java.lang.Class, de.xwic.appkit.core.model.queries.resolver.hbn.QueryResolver)
  */
 public void registerQuery(
     Class<? extends EntityQuery> queryClass, IEntityQueryResolver resolver) {
   provider.registerQuery(queryClass, resolver);
 }
Exemplo n.º 2
0
  /**
   * Construct a new DAO Factory.
   *
   * @param provider
   * @param useLocalDAO
   */
  public DefaultDAOFactory(DAOProvider provider, boolean useLocalDAO) {
    if (provider == null) {
      throw new IllegalArgumentException("Provider in " + getClass().getName() + " is null!");
    }
    this.provider = provider;

    ServerConfigPropertyDAO propDao = new ServerConfigPropertyDAO();
    propDao.setProvider(provider);
    daos.put(IServerConfigPropertyDAO.class, propDao);

    PicklisteDAO plDao = useLocalDAO ? new LocalPicklisteDAO() : new PicklisteDAO();
    plDao.setProvider(provider);
    daos.put(IPicklisteDAO.class, plDao);

    AnhangDAO ahDao = useLocalDAO ? new LocalAnhangDAO() : new AnhangDAO();
    ahDao.setProvider(provider);
    daos.put(IAnhangDAO.class, ahDao);

    SyncStateDAO ssDao = new SyncStateDAO();
    ssDao.setProvider(provider);
    daos.put(ISyncStateDAO.class, ssDao);

    ReportTemplateDAO rtDao = new ReportTemplateDAO();
    rtDao.setProvider(provider);
    daos.put(IReportTemplateDAO.class, rtDao);

    ReportFolderDAO rfDao = new ReportFolderDAO();
    rfDao.setProvider(provider);
    daos.put(IReportFolderDAO.class, rfDao);

    MonitoringElementDAO meDao = new MonitoringElementDAO();
    meDao.setProvider(provider);
    daos.put(IMonitoringElementDAO.class, meDao);

    SystemTraceStatisticDAO stsDAO = new SystemTraceStatisticDAO();
    stsDAO.setProvider(provider);
    daos.put(ISystemTraceStatisticDAO.class, stsDAO);

    provider.registerQuery(PicklistTextQuery.class, new PicklistTextQueryResolver());
    provider.registerQuery(PicklistEntryQuery.class, new PicklistEntryQueryResolver());
    provider.registerQuery(PicklistQuery.class, new PickListQueryResolver());
    provider.registerQuery(HsqlQuery.class, new HsqlQueryResolver());
    provider.registerQuery(SetRelatedQuery.class, new SetRelatedQueryResolver());

    // security DAOs

    ActionDAO actionDAO = useLocalDAO ? new LocalActionDAO() : new ActionDAO();
    actionDAO.setProvider(provider);
    daos.put(IActionDAO.class, actionDAO);

    ActionSetDAO actionSetDAO = useLocalDAO ? new LocalActionSetDAO() : new ActionSetDAO();
    actionSetDAO.setProvider(provider);
    daos.put(IActionSetDAO.class, actionSetDAO);

    RightDAO rightDAO = useLocalDAO ? new LocalRightDAO() : new RightDAO();
    rightDAO.setProvider(provider);
    daos.put(IRightDAO.class, rightDAO);

    RoleDAO roleDAO = useLocalDAO ? new LocalRoleDAO() : new RoleDAO();
    roleDAO.setProvider(provider);
    daos.put(IRoleDAO.class, roleDAO);

    ScopeDAO scopeDAO = useLocalDAO ? new LocalScopeDAO() : new ScopeDAO();
    scopeDAO.setProvider(provider);
    daos.put(IScopeDAO.class, scopeDAO);

    UserDAO userDAO = useLocalDAO ? new LocalUserDAO() : new UserDAO();
    userDAO.setProvider(provider);
    daos.put(IUserDAO.class, userDAO);

    UserSessionDAO userSessionDAO = new UserSessionDAO();
    userSessionDAO.setProvider(provider);
    daos.put(IUserSessionDAO.class, userSessionDAO);

    EntityCommentDAO ecDAO = new EntityCommentDAO();
    ecDAO.setProvider(provider);
    daos.put(IEntityCommentDAO.class, ecDAO);

    MitarbeiterDAO cmDao = new MitarbeiterDAO();
    registerDao(IMitarbeiterDAO.class, useLocalDAO ? new LocalMitarbeiterDAO() : cmDao);

    SalesTeamDAO stDao = useLocalDAO ? new LocalSalesTeamDAO() : new SalesTeamDAO();
    registerDao(ISalesTeamDAO.class, stDao);

    registerDao(IMitarbeiterRelationDAO.class, new MitarbeiterRelationDAO());

    registerDao(IUserListProfileDAO.class, new UserListProfileDAO());
    registerDao(IUserViewConfigurationDAO.class, new UserViewConfigurationDAO());

    provider.registerQuery(UserQuery.class, new UserQueryResolver());
    provider.registerQuery(RightQuery.class, new RightQueryResolver());
    provider.registerQuery(UniqueActionQuery.class, new UniqueActionResolver());
    provider.registerQuery(UniqueActionSetQuery.class, new UniqueActionSetResolver());
    provider.registerQuery(UniqueRightQuery.class, new UniqueRightResolver());
    provider.registerQuery(UniqueRoleQuery.class, new UniqueRoleResolver());
    provider.registerQuery(UniqueScopeQuery.class, new UniqueScopeResolver());
    provider.registerQuery(UniqueUserQuery.class, new UniqueUserResolver());

    provider.registerQuery(PropertyQuery.class, new PropertyQueryResolver());

    provider.registerQuery(AllUNBetreuerQuery.class, new AllUNBetreuerQueryResolver());
    provider.registerQuery(UniqueSTQuery.class, new UniqueSTQueryResolver());
    provider.registerQuery(CMFastSearchQuery.class, new CMQueryShortFilterResolver());
  }