mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-09 05:48:20 +00:00
Fixed categorical filtering on enums
This commit is contained in:
parent
b6cfe37c84
commit
3183c810b7
@ -245,11 +245,18 @@ public class DbField {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Set<DbFieldValue> getAllValues() {
|
public Set<DbFieldValue> getAllValues() {
|
||||||
|
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();
|
List<?> findAll = schema.getJpaRepository().findAll();
|
||||||
return findAll.stream()
|
return findAll.stream()
|
||||||
.map(o -> new DbObject(o, schema).get(this))
|
.map(o -> new DbObject(o, schema).get(this))
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user