Posts Tagged Hibernate

NonUniqueResultException in Hibernate

March 6, 2012
NonUniqueResultException in Hibernate

Sometimes we will get the NonUniqueResultException when we tried to get the result-set by executing query using Hibernate. The following is the stack trace of the exception: query did not return a unique result: 2 org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.hibernate.internal.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:899) at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:890) at org.bss.dao.SampleDAO.main(SampleDAO.java:84) This happens because you’re expecting [...]

 

If you have a Tip, Comment, Article or anything you want to share, please send it to: i@poisure.com