I\'m looking for a builder for HQL in Java. I want to get rid of things like:
StringBuilder builder = new StringBuilder() .append(\"select stock from \")
Criteria API does not provide all functionality avaiable in HQL. For example, you cannot do more than one join over the same column.
Why don't you use NAMED QUERIES? The look much more clean:
Person person = session.getNamedQuery("Person.findByName") .setString(0, "Marcio") .list();