Is writing
session.createCriteria(Person.class)
.add(Restrictions.eq("id", personId))
.setMaxResults(1)
.uniqueResult();
better than writing
session.createCriteria(Person.class)
.add(Restrictions.eq("id", personId))
.uniqueResult();
from an optimization point of view? Will the first query be faster?