Package sino.dao

Examples of sino.dao.DaoException


        try {
            result = (T) query.getSingleResult();

            return result;
        } catch (NonUniqueResultException e) {
            throw new DaoException("The query '" + query + "' should get a single result. Error message: "
                    + e.getMessage(), e);
        } catch (NoResultException e) {
            return null;
        } catch (RuntimeException e) {
            throw new DaoException("Cannot run query '" + query + "'. Runtime exception: " + e.getMessage(), e);
        } finally {
            logQueryResult(startTime, result);
        }
    }
View Full Code Here


        try {
            result = query.getResultList();

            return result;
        } catch (RuntimeException e) {
            throw new DaoException("Cannot run query '" + query + "'. Runtime exception: " + e.getMessage(), e);
        } finally {
            logQueryResult(startTime, result);
        }
    }
View Full Code Here

        try {
            result = query.getResultList();

            return result;
        } catch (RuntimeException e) {
            throw new DaoException("Cannot run query '" + query + "'. Runtime exception: " + e.getMessage(), e);
        } finally {
            logQueryResult(startTime, result);
        }
    }
View Full Code Here

        ParamUtility.checkState(null, this.entityManager, "entityManager");

        try {
            this.entityManager.persist(entity);
        } catch (IllegalArgumentException e) {
            throw new DaoException("Cannot persist the entity " + entity + ". Illegal argument exception: "
                    + e.getMessage(), e);
        } catch (PersistenceException e) {
            throw new DaoException(
                    "Cannot persist the entity " + entity + ". Persistence exception: " + e.getMessage(), e);
        }

        return entity;
    }
View Full Code Here

        ParamUtility.checkState(null, this.entityManager, "entityManager");

        try {
            this.entityManager.merge(entity);
        } catch (PersistenceException e) {
            throw new DaoException("Cannot update entity " + entity + ". Persistence exception: " + e.getMessage(), e);
        }
    }
View Full Code Here

        ParamUtility.checkState(null, this.entityManager, "entityManager");

        try {
            this.entityManager.remove(entity);
        } catch (PersistenceException e) {
            throw new DaoException("Cannot delete entity " + entity + ". Persistence exception: " + e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of sino.dao.DaoException

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.