[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - javax.persistence.Query.getSingleResult() doesn't comply wit

mohammadk do-not-reply at jboss.com
Thu May 22 17:52:32 EDT 2008


According to the javadoc (http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#getSingleResult())
 getSingleResult method is supposed to throw NoResultException when there is no result. 

the hibernate version bundled with JBoss 4.0.4 complies to the spec, but the one bundled with JBoss 4.2.2 does not follow the specification and instead returns null when there is no result. Wondering if there is any quick workaround for this problem at JBoss level? Otherwise we have to change all the code which doesn't make sense.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152828#4152828

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152828



More information about the jboss-user mailing list