Skip to content

Commit

Permalink
Merge pull request #114 from viniciosarodrigues/develop
Browse files Browse the repository at this point in the history
bug: ajuste em filtros de Procedimentos
  • Loading branch information
viniciosarodrigues authored May 22, 2020
2 parents fc26a04 + c3f4a93 commit 315bb2b
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 315bb2b

Please sign in to comment.