My implementation kind of abuses Query.getSingleResult() to also allow executing an update query. Let me know, if this is not acceptable. Otherwise, I would be glad to get some hints on what would be needed to allow an update query to be executable only with Query.executeUpdate(). Also, findAndUpdate is a kind of corner case, clearly. Do you think that it is ok to allow it with Query.getSingleResult()? |