This commit is contained in:
Francesco
2023-09-27 10:21:36 +02:00
parent 9091ba365a
commit 747f07e041
5 changed files with 78 additions and 72 deletions

View File

@@ -16,5 +16,5 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Filterable {
public String type() default "";
public FilterableType type() default FilterableType.DEFAULT;
}

View File

@@ -0,0 +1,5 @@
package tech.ailef.dbadmin.external.annotations;
public enum FilterableType {
DEFAULT, CATEGORICAL;
}

View File

@@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import tech.ailef.dbadmin.external.annotations.DisplayImage;
import tech.ailef.dbadmin.external.annotations.Filterable;
import tech.ailef.dbadmin.external.annotations.FilterableType;
public class DbField {
protected String dbName;
@@ -139,7 +140,7 @@ public class DbField {
public boolean isFilterableCategorical() {
Filterable filterable = getPrimitiveField().getAnnotation(Filterable.class);
return filterable != null && filterable.type().equalsIgnoreCase("categorical");
return filterable != null && filterable.type() == FilterableType.CATEGORICAL;
}
public Set<DbFieldValue> getAllValues() {