List of usage examples for org.hibernate.engine.jdbc.internal BasicFormatterImpl format
@Override
public String format(String source)
From source file:be.shad.tsqb.hql.HqlQuery.java
License:Apache License
/** * String with newlines and spaces to outline the query in a pretty format. *///from ww w . j ava2s.co m public String toFormattedString() { BasicFormatterImpl formatter = new BasicFormatterImpl(); String prettyHql = formatter.format(getHql()); prettyHql = prettyHql.replaceAll("((from|join|select|where)\\n\\s*)", "$2 "); return prettyHql + "\n --- with: " + params.toString().replace("PARAM [", "\n["); }