Package dao

Examples of dao.DataAccessException


            typedQuery.setParameter("term", "%" + term + "%");

            return typedQuery.getResultList().size();
        } catch (Throwable throwable) {
            Logger.error("failed to get quick search results count");
            throw new DataAccessException("failed to get quick search results count", throwable);
        }
    }
View Full Code Here


            Session session = (Session) JPA.em().getDelegate();
            Criteria criteria = session.createCriteria(entityClass);
            return criteria.list();
        }catch(Throwable throwable){
            Logger.error("failed to get list of" + entityClass);
            throw new DataAccessException("failed to get list of " + entityClass, throwable);
        }
    }
View Full Code Here

                JPA.em().merge(entity);
            }
            JPA.em().flush();
        } catch (Throwable throwable) {
            Logger.error("failed to perist entity of class " + entityClass);
            throw new DataAccessException("failed to perist entity of class " + entityClass, throwable);
        }
    }
View Full Code Here

    public void remove(T entity) throws DataAccessException {
        try {
            JPA.em().remove(entity);
        } catch (Throwable throwable) {
            Logger.error("failed to remove entity of class " + entityClass);
            throw new DataAccessException("failed to remove entity of class " + entityClass, throwable);
        }
    }
View Full Code Here

        }
        try {
            return (T) JPA.em().find(entityClass, id);
        } catch (Throwable throwable) {
            Logger.error("failed to get by id " + id);
            throw new DataAccessException("failed to get by id " + id, throwable);
        }
    }
View Full Code Here

            CriteriaQuery<T> select = criteriaQuery.select(from);
            TypedQuery<T> typedQuery = JPA.em().createQuery(select);
            return getBatch(batchNumber, batchSize, typedQuery);
        } catch (Throwable throwable) {
            Logger.error("failed to get batch " + batchNumber + " of size " + batchSize);
            throw new DataAccessException("failed to get batch " + batchNumber + " of size " + batchSize, throwable);
        }
    }
View Full Code Here

            CriteriaQuery<Long> countQuery = criteriaBuilder.createQuery(Long.class);
            countQuery.select(criteriaBuilder.count(countQuery.from(entityClass)));
            return Integer.valueOf((int)(long)(em.createQuery(countQuery).getSingleResult()));
        } catch (Throwable throwable) {
            Logger.error("failed to get batch entities count");
            throw new DataAccessException("failed to get batch entities count", throwable);
        }
    }
View Full Code Here

//            TypedQuery<Phone> typedQuery = JPA.em().createQuery(select);
            return null;

        } catch (Throwable throwable) {
            Logger.error("failed to get phones from contactID = "+id);
            throw new DataAccessException("failed to get phones from contactID = "+id, throwable);
        }
    }
View Full Code Here

            typedQuery.setParameter("term", term + "%");

            return getBatch(batchNumber, batchSize, typedQuery);
        } catch (Throwable throwable) {
            Logger.error("failed to get batch " + batchNumber + " of size " + batchSize);
            throw new DataAccessException("failed to get batch " + batchNumber + " of size " + batchSize, throwable);
        }
    }
View Full Code Here

            typedQuery.setParameter("term", term + "%");

            return typedQuery.getResultList().size();
        } catch (Throwable throwable) {
            Logger.error("failed to get quick user search results count");
            throw new DataAccessException("failed to get quick user search results count", throwable);
        }
    }
View Full Code Here

TOP

Related Classes of dao.DataAccessException

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.