Package org.hibernate

Examples of org.hibernate.NonUniqueResultException


      assertEquals(TestBean.class.getName(), ex.getPersistentClassName());
      assertEquals("id", ex.getIdentifier());
      assertEquals(wcex, ex.getCause());
    }

    final NonUniqueResultException nuex = new NonUniqueResultException(2);
    try {
      createTemplate().execute(new HibernateCallback() {
        public Object doInHibernate(org.hibernate.Session session) throws HibernateException {
          throw nuex;
        }
View Full Code Here


    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

        query.setParameter("bpmAddress", bpmAddress);

        List< ? > results = query.getResultList();
        if (results.size() > 1)
        {
            throw new NonUniqueResultException(results.size());
        }

        return results.isEmpty() ? null : (InitiatorMapping) results.get(0);
    }
View Full Code Here

        if(list.isEmpty()) { return null; }

        T firstItem = list.get(0);
        for(T t : list) {
            if(!t.equals(firstItem)) {
                throw new NonUniqueResultException(list.size());
            }
        }

        return firstItem;
    }
View Full Code Here

    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

    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

    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

    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

    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

      assertEquals(TestBean.class.getName(), ex.getPersistentClassName());
      assertEquals("id", ex.getIdentifier());
      assertEquals(wcex, ex.getCause());
    }

    final NonUniqueResultException nuex = new NonUniqueResultException(2);
    try {
      hibernateTemplate.execute(new HibernateCallback<Object>() {
        @Override
        public Object doInHibernate(Session session)  {
          throw nuex;
View Full Code Here

TOP

Related Classes of org.hibernate.NonUniqueResultException

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.