Skip to content

Commit

Permalink
bug: ajuste em filtros de Procedimentos
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciosarodrigues committed May 22, 2020
1 parent 76cb7a7 commit c3f4a93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,15 @@
@EqualsAndHashCode(callSuper = true)
public class ProcedureOrEventFilters extends CustomFilters {

private static final long serialVersionUID = -8122726857291316469L;
private static final long serialVersionUID = -8122726857291316469L;

private String id;
private String id;

private String description = "";
private String description = "";

private ActiveType activeType;
private ActiveType activeType;

public ActiveType getActiveType() {
if (activeType == null)
this.activeType = ActiveType.ACTIVE;
return this.activeType;
}

public String getDescription() {
return "%".concat(this.description).concat("%");
}
public String getDescription() {
return "%".concat(this.description).concat("%");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected List<IExpression<ProcedureOrEvent>> createRestrictions(CustomFilters c
attributes.add((cb, from) -> cb.equal(from.get("id"), Long.parseLong(filters.getId())));
}
if (!StringUtils.isNullOrEmpty(filters.getDescription())) {
attributes.add((cb, from) -> cb.equal(from.get("description"), filters.getDescription()));
attributes.add((cb, from) -> cb.like(from.get("description"), filters.getDescription()));
}
if (filters.getActiveType() != null) {
attributes.add((cb, from) -> cb.equal(from.get("active"), filters.getActiveType() == ActiveType.ACTIVE));
Expand Down

0 comments on commit c3f4a93

Please sign in to comment.