@Override public int executeUpdate() { execute(); return _callback.getUpdateCount(); }
@Override public int executeUpdate() { execute(); return _callback.getUpdateCount(); }
@Override public List getResultList() { execute(); try { Object list = _callback.callback(); RuntimeExceptionTranslator trans = PersistenceExceptions .getRollbackTranslator(_delegate.getEntityManager()); return new DelegatingResultList((ResultList) list, trans); } catch (Exception ex) { throw new javax.persistence.PersistenceException(ex); } }
@Override public List getResultList() { execute(); try { Object list = _callback.callback(); RuntimeExceptionTranslator trans = PersistenceExceptions .getRollbackTranslator(_delegate.getEntityManager()); return new DelegatingResultList((ResultList) list, trans); } catch (Exception ex) { throw new javax.persistence.PersistenceException(ex); } }
@Override public Object getSingleResult() { execute(); try { ResultList result = (ResultList) _callback.callback(); if (result == null || result.isEmpty()) throw new NoResultException(_loc.get("no-result", _name) .getMessage()); if (result.size() > 1) throw new NonUniqueResultException(_loc.get("non-unique-result", _name, result.size()).getMessage()); RuntimeExceptionTranslator trans = PersistenceExceptions .getRollbackTranslator(_delegate.getEntityManager()); return new DelegatingResultList(result, trans).iterator().next(); } catch (Exception ex) { throw new javax.persistence.PersistenceException(ex); } }
@Override public Object getSingleResult() { execute(); try { ResultList result = (ResultList) _callback.callback(); if (result == null || result.isEmpty()) throw new NoResultException(_loc.get("no-result", _name) .getMessage()); if (result.size() > 1) throw new NonUniqueResultException(_loc.get("non-unique-result", _name, result.size()).getMessage()); RuntimeExceptionTranslator trans = PersistenceExceptions .getRollbackTranslator(_delegate.getEntityManager()); return new DelegatingResultList(result, trans).iterator().next(); } catch (Exception ex) { throw new javax.persistence.PersistenceException(ex); } }