Я еще ничего не добавлял в свою базу данных, поэтому, по моим расчетам, следующий запрос должен вернуть результат 0.
Query query = pm.newQuery(Password.class);
query.setFilter("password == :passwordParam");
query.setResult("count(password)");
query.setResultClass(Integer.class);
Integer result = (Integer)query.execute(password);
System.out.println("Result: [" + result + "]");
Он возвращает null
Ни javadocs, ни документы результатов ничего не говорят о том, что этот метод может возвращать значение null. Думаю, я сделал что-то не так.
http://db.apache.org/jdo/api20/apidocs/javax/jdo/Query.html#execute%28%29 http://www.datanucleus.org/products/accessplatformnull
2/jdo/jdoql_result.html