Skip to content

SpecField

Fagner Lima edited this page Aug 24, 2020 · 1 revision

Used for single conditions.

Params:

  • value: the name of the field in the entity;
    • default: the name of the field in the filter.
  • operation: the operation of the query (SpecOperation enum);
    • default: SpecOperation.EQUAL.
  • canBeNull: if true and the value is null, the condition IS NULL will be included.
    • default: false.

At the moment, the SpecOperation's EQUAL_IGNORE_CASE_UNACCENT and LIKE_IGNORE_CASE_UNACCENT can be used only with PostgreSQL and require the unaccent extension.

Example:

@SpecEntity(Task.class)
public class TaskFilter implements Serializable {
  // ...

  @SpecField(operation = SpecOperation.LIKE_IGNORE_CASE)
  private String description;

  private Status status;

  // getters and setters
}
Clone this wiki locally