Fixed categorical filtering on enums

This commit is contained in:
Francesco committed 2023-10-25 10:11:25 +02:00
1 parent b6cfe37c84
commit 3183c810b7
1 file changed
+11 -4
@@ -245,10 +245,17 @@ public class DbField {
}
public Set<DbFieldValue> getAllValues() {
List<?> findAll = schema.getJpaRepository().findAll();
return findAll.stream()
.map(o -> new DbObject(o, schema).get(this))
.collect(Collectors.toSet());
if (type instanceof EnumFieldType) {
List<?> values = type.getValues();
return values.stream().map(v -> {
return new DbFieldValue(v, this);
}).collect(Collectors.toSet());
} else {
List<?> findAll = schema.getJpaRepository().findAll();
return findAll.stream()
.map(o -> new DbObject(o, schema).get(this))
.collect(Collectors.toSet());
}
}
@Override