[PATCH] implement Query.getSingleResult