if (!type.isCollectionType()) {
log.debug("Atributo adicionado: " + name);
FindByAttribute findByAttibute = getFindByAttributeAnnotation(name);
if (findByAttibute == null) {
if (type instanceof StringType) {
criteria.add(Restrictions.like(name, "%" + value + "%"));
} else {
criteria.add(Restrictions.eq(name, value));
}
} else {
if (type instanceof StringType) {
StringComparation stringComparation = findByAttibute.stringComparation();
if(stringComparation != null && stringComparation == StringComparation.EXACT) {
criteria.add(Restrictions.eq(name, value));
} else if(stringComparation != null && stringComparation == StringComparation.END) {
criteria.add(Restrictions.like(name, "%" + value));
} else if(stringComparation != null && stringComparation == StringComparation.START) {
criteria.add(Restrictions.like(name, value + "%"));
} else {
criteria.add(Restrictions.like(name, "%" + value + "%"));
}
} else if (type instanceof TimestampType) {
DateComparation dateComparation = findByAttibute.dateComparation();
if(dateComparation != null && dateComparation == DateComparation.EXACT) {
criteria.add(Restrictions.eq(name, value));
} else if(dateComparation != null && dateComparation == DateComparation.GREATER_THAN) {
criteria.add(Restrictions.ge(name, value));
} else if(dateComparation != null && dateComparation == DateComparation.LESS_THAN) {