List of usage examples for org.hibernate.criterion Example setEscapeCharacter
public Example setEscapeCharacter(Character escapeCharacter)
From source file:py.una.pol.karaku.dao.impl.BaseDAOImpl.java
License:Open Source License
protected Criteria generateWhere(final Where<T> where, @Nonnull final Map<String, String> alias, Criteria criteria) {/*from www. j a va2 s. c o m*/ if (where != null) { EntityExample<T> example = where.getExample(); if (example != null && example.getEntity() != null) { Example ejemplo = Example.create(example.getEntity()); ejemplo.enableLike(example.getMatchMode().getMatchMode()); ejemplo.setEscapeCharacter('\\'); if (example.isIgnoreCase()) { ejemplo.ignoreCase(); } if (example.isExcludeZeroes()) { ejemplo.excludeZeroes(); } criteria.add(ejemplo); if (example.getExcluded() != null) { for (String excluded : example.getExcluded()) { ejemplo.excludeProperty(excluded); } } this.configureExample(criteria, example.getEntity()); } for (String s : where.getFetchs()) { criteria.setFetchMode(s, FetchMode.JOIN); } helper.applyClauses(criteria, where, alias); } return criteria; }