mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-08 21:38:21 +00:00
Fixed categorical filtering on enums
This commit is contained in:
parent
b6cfe37c84
commit
3183c810b7
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user