Package com.peusoft.ptcollect.server.persistance.dao

Examples of com.peusoft.ptcollect.server.persistance.dao.GenericDao


    }

    @SuppressWarnings("unchecked")
  @Override
    public GenericDao getDao(Class<? extends AbstractDomainObject> clazz) {
        GenericDao dao = daoMap.get(clazz);
        if (dao != null) {
            return dao;
        } else {
            throw new PTException(ErrorCode.ERR_PERSISTENCE_DAO_NOT_SUPPORTED,
                    messageHelper.getErrorMessage(ErrorCode.ERR_PERSISTENCE_DAO_NOT_SUPPORTED,
View Full Code Here


     * Calls { @link GenericDao#getAll(Class) }.
     */
    @SuppressWarnings("unchecked")
  @Override
    public <T extends AbstractDomainObject> List<T> getAll(Class<T> clazz) throws PTException {
      GenericDao dao = daoFactory.getDao(clazz);
        return (List<T>) dao.findAll();
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  @Override
    public <T extends AbstractDomainObject> boolean isObjectInUse(T object) {
        GenericDao dao = daoFactory.getDao((Class<T>) object.getClass());
        return dao.isObjectInUse(object);
    }
View Full Code Here

        // save states
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("saving objects... ");
        }
        for (AbstractDomainObject object : objects) {
            GenericDao dao = daoFactory.getDao(object.getClass());
            dao.merge(object);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("save object " + object);
            }
        }
    }
View Full Code Here

        // delete objects
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("deleting objects... ");
        }
        for (AbstractDomainObject object : objects) {
            GenericDao dao = daoFactory.getDao(object.getClass());
            dao.remove(object);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("delete " + object);
            }
        }
    }
View Full Code Here

        // save states
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("creating objects... ");
        }
        for (AbstractDomainObject object : objects) {
            GenericDao dao = daoFactory.getDao(object.getClass());
            dao.persist(object);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("create object " + object);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.peusoft.ptcollect.server.persistance.dao.GenericDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.