Examples of NonUniqueResultException


Examples of javax.persistence.NonUniqueResultException

    NoResultException noResult = new NoResultException();
    assertSame(EmptyResultDataAccessException.class,
        EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(noResult).getClass());

    NonUniqueResultException nonUniqueResult = new NonUniqueResultException();
    assertSame(IncorrectResultSizeDataAccessException.class,
        EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(nonUniqueResult).getClass());

    OptimisticLockException optimisticLock = new OptimisticLockException();
    assertSame(JpaOptimisticLockingFailureException.class,
View Full Code Here

Examples of javax.persistence.NonUniqueResultException

        List<?> rows = getResultList();
        if (rows.size() == 0) {
            throw new NoResultException();
        }
        if (rows.size() > 1) {
            throw new NonUniqueResultException();
        }

        return rows.get(0);
    }
View Full Code Here

Examples of org.apache.openjpa.util.NonUniqueResultException

            // no results
            Object single = null;
            if (next) {
                single = rop.getResultObject();
                if (range.end != range.start + 1 && rop.next())
                    throw new NonUniqueResultException(_loc.get("not-unique",
                        _class, _query));
            } else if (_unique == Boolean.TRUE)
                throw new NoResultException(_loc.get("no-result",
                    _class, _query));
View Full Code Here

Examples of org.apache.openjpa.util.NonUniqueResultException

            // no results
            Object single = null;
            if (next) {
                single = rop.getResultObject();
                if (range.end != range.start + 1 && rop.next())
                    throw new NonUniqueResultException(_loc.get("not-unique",
                        _class, _query));
            } else if (_unique == Boolean.TRUE)
                throw new NoResultException(_loc.get("no-result",
                    _class, _query));
View Full Code Here

Examples of org.hibernate.NonUniqueResultException

    int size = list.size();
    if (size==0) return null;
    Object first = list.get(0);
    for ( int i=1; i<size; i++ ) {
      if ( list.get(i)!=first ) {
        throw new NonUniqueResultException( list.size() );
      }
    }
    return first;
  }
View Full Code Here

Examples of org.hibernate.NonUniqueResultException

    int size = list.size();
    if (size==0) return null;
    Object first = list.get(0);
    for ( int i=1; i<size; i++ ) {
      if ( list.get(i)!=first ) {
        throw new NonUniqueResultException( list.size() );
      }
    }
    return first;
  }
View Full Code Here

Examples of org.hibernate.NonUniqueResultException

    int size = list.size();
    if (size==0) return null;
    Object first = list.get(0);
    for ( int i=1; i<size; i++ ) {
      if ( list.get(i)!=first ) {
        throw new NonUniqueResultException( list.size() );
      }
    }
    return first;
  }
View Full Code Here

Examples of org.hibernate.NonUniqueResultException

    int size = list.size();
    if (size==0) return null;
    Object first = list.get(0);
    for ( int i=1; i<size; i++ ) {
      if ( list.get(i)!=first ) {
        throw new NonUniqueResultException( list.size() );
      }
    }
    return first;
  }
View Full Code Here

Examples of org.hibernate.NonUniqueResultException

    int size = list.size();
    if (size==0) return null;
    Object first = list.get(0);
    for ( int i=1; i<size; i++ ) {
      if ( list.get(i)!=first ) {
        throw new NonUniqueResultException( list.size() );
      }
    }
    return first;
  }
View Full Code Here

Examples of org.hibernate.NonUniqueResultException

    int size = list.size();
    if (size==0) return null;
    Object first = list.get(0);
    for ( int i=1; i<size; i++ ) {
      if ( list.get(i)!=first ) {
        throw new NonUniqueResultException( list.size() );
      }
    }
    return first;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.