* (non-Javadoc)
* @see org.dayatang.domain.EntityRepository#findByExample(org.dayatang.domain.Entity, org.dayatang.domain.ExampleSettings)
*/
@Override
public <T extends Entity, E extends T> List<T> findByExample(final E example, final ExampleSettings<T> settings) {
Example theExample = Example.create(example);
if (settings.isLikeEnabled()) {
theExample.enableLike(MatchMode.ANYWHERE);
}
if (settings.isIgnoreCaseEnabled()) {
theExample.ignoreCase();
}
if (settings.isExcludeNone()) {
theExample.excludeNone();
}
if (settings.isExcludeZeroes()) {
theExample.excludeZeroes();
}
for (String propName : settings.getExcludedProperties()) {
theExample.excludeProperty(propName);
}
return getSession().createCriteria(settings.getEntityClass()).add(theExample).list();
}