datanucleus / datanucleus-api-jdo

Support for DataNucleus persistence using the JDO API (JSR0012, JSR0243)
18 stars 27 forks source link

JDOQLTypedQuery executeResultList(Class) and executeResultUnique(Class) should allow result class but no result #97

Closed andyjefferson closed 5 years ago

andyjefferson commented 5 years ago

Due to cut-and-paste all of the executeResultXXX methods just have a check

if (result == null)
{
    throw new JDOUserException("Cannot call executeResultList method when query has result unset. Call executeList instead.");
}

In the case of the methods that take in a result class, this should check on BOTH result and resultCls being null, since we should allow no result but a result class.