Before I posted this question, I already looked this, but I couldn\'t get what I was looking for.
I know that for the query I wrote there may exist only one row or n
You mentioned getting the result list from the Query, since you don't know that there is a UniqueResult (hence the exception) you could use list and check the size?
if (query.list().size() == 1)
Since you're not doing a get() to get your unique object a query will be executed whether you call uniqueResult or list.