List of usage examples for javax.persistence Query getHints
Map<String, Object> getHints();
From source file:net.sf.gazpachoquest.qbe.NamedQueryUtil.java
/** * If the named query has the "query" hint, it uses the hint value (which * must be jpa QL) to create a new query and * append to it the proper order by clause. *///from ww w. jav a2 s . com private String getQueryString(final Query query) { Map<String, Object> hints = query.getHints(); return hints != null ? (String) hints.get("query") : null; }
From source file:net.sf.gazpachoquest.qbe.NamedQueryUtil.java
private Query recreateQuery(final Query current, final String newSqlString) { Query result = entityManager.createQuery(newSqlString); Map<String, Object> hints = current.getHints(); for (Entry<String, Object> entry : hints.entrySet()) { String hintName = entry.getKey(); Object hint = entry.getValue(); result.setHint(hintName, hint);//from w w w.j a va2 s . c om } return result; }