equal
deleted
inserted
replaced
232 } |
232 } |
233 } |
233 } |
234 query.where(cb.and(predicates.toArray(new Predicate[predicates.size()]))); |
234 query.where(cb.and(predicates.toArray(new Predicate[predicates.size()]))); |
235 T result = null; |
235 T result = null; |
236 try { |
236 try { |
237 result = em.createQuery(query).getSingleResult(); |
237 result = getSingleResult(em.createQuery(query)); |
238 } catch (NoResultException e) { |
238 } catch (NoResultException e) { |
239 log.info("Object not found in Database: " + e.getMessage()); |
239 log.info("Object not found in Database: " + e.getMessage()); |
240 } |
240 } |
241 return result; |
241 return result; |
242 } |
242 } |
256 |
256 |
257 public Object find(String jpql, Object ... paramValues) { |
257 public Object find(String jpql, Object ... paramValues) { |
258 Query query = em.createQuery(jpql); |
258 Query query = em.createQuery(jpql); |
259 for (int i = 0; i < paramValues.length; i++) |
259 for (int i = 0; i < paramValues.length; i++) |
260 query.setParameter(i + 1, paramValues[i]); |
260 query.setParameter(i + 1, paramValues[i]); |
261 return query.getSingleResult(); |
261 return getSingleResult(query); |
262 } |
262 } |
263 |
263 |
264 public boolean contains(Collection entities) { |
264 public boolean contains(Collection entities) { |
265 boolean res = true; |
265 boolean res = true; |
266 entities.each {res &= contains(it)} |
266 entities.each {res &= contains(it)} |