When querying by Example with JPA, is there a way to specify null matching for one column instead of all? It seems like the Null matching can only be applied to all columns.
class Entity {
private Integer id;
private String name;
private Instant createdAt;
private Instant deletedAt;
// getters and setters
}
When querying by example, I want to include when deletedAt
is actually null in the example, but ignore the null matching on other fields. In the database, the created_at
column is a TIMESTAMP WITHOUT TIME ZONE
column (postgresql)
Edit: Solutions proposed in Spring data query where column is null aren't applicable since they don't take advantage of querying by example