This commit is contained in:
@@ -155,18 +155,12 @@ final class FilterBeanNode extends FilterNode {
|
|||||||
|
|
||||||
private Attribute columnAttribute;
|
private Attribute columnAttribute;
|
||||||
|
|
||||||
private boolean array;
|
private long least;
|
||||||
|
|
||||||
private boolean collection;
|
|
||||||
|
|
||||||
private boolean string;
|
private boolean string;
|
||||||
|
|
||||||
private boolean number;
|
private boolean number;
|
||||||
|
|
||||||
private boolean ignoreCase;
|
|
||||||
|
|
||||||
private long least;
|
|
||||||
|
|
||||||
protected FilterBeanNode(String col, boolean sign, Attribute beanAttr) {
|
protected FilterBeanNode(String col, boolean sign, Attribute beanAttr) {
|
||||||
this.column = col;
|
this.column = col;
|
||||||
this.and = sign;
|
this.and = sign;
|
||||||
@@ -177,15 +171,12 @@ final class FilterBeanNode extends FilterNode {
|
|||||||
final FilterColumn fc = field.getAnnotation(FilterColumn.class);
|
final FilterColumn fc = field.getAnnotation(FilterColumn.class);
|
||||||
if (fc != null && !fc.name().isEmpty()) this.column = fc.name();
|
if (fc != null && !fc.name().isEmpty()) this.column = fc.name();
|
||||||
final Class type = field.getType();
|
final Class type = field.getType();
|
||||||
this.array = type.isArray();
|
|
||||||
this.collection = Collection.class.isAssignableFrom(type);
|
|
||||||
this.least = fc == null ? 1L : fc.least();
|
this.least = fc == null ? 1L : fc.least();
|
||||||
this.ignoreCase = fc == null ? true : fc.ignoreCase();
|
|
||||||
this.number = (type.isPrimitive() && type != boolean.class) || Number.class.isAssignableFrom(type);
|
this.number = (type.isPrimitive() && type != boolean.class) || Number.class.isAssignableFrom(type);
|
||||||
this.string = CharSequence.class.isAssignableFrom(type);
|
this.string = CharSequence.class.isAssignableFrom(type);
|
||||||
|
|
||||||
FilterExpress exp = fc == null ? null : fc.express();
|
FilterExpress exp = fc == null ? null : fc.express();
|
||||||
if (this.array || this.collection) {
|
if (type.isArray() || Collection.class.isAssignableFrom(type)) {
|
||||||
if (Range.class.isAssignableFrom(type.getComponentType())) {
|
if (Range.class.isAssignableFrom(type.getComponentType())) {
|
||||||
if (AND != exp) exp = OR;
|
if (AND != exp) exp = OR;
|
||||||
} else {
|
} else {
|
||||||
@@ -208,9 +199,6 @@ final class FilterBeanNode extends FilterNode {
|
|||||||
newnode.byjoinColumn = this.byjoinColumn;
|
newnode.byjoinColumn = this.byjoinColumn;
|
||||||
newnode.foreignAttribute = this.foreignAttribute;
|
newnode.foreignAttribute = this.foreignAttribute;
|
||||||
newnode.columnAttribute = this.columnAttribute;
|
newnode.columnAttribute = this.columnAttribute;
|
||||||
newnode.array = this.array;
|
|
||||||
newnode.collection = this.collection;
|
|
||||||
newnode.ignoreCase = this.ignoreCase;
|
|
||||||
newnode.least = this.least;
|
newnode.least = this.least;
|
||||||
newnode.number = this.number;
|
newnode.number = this.number;
|
||||||
newnode.string = this.string;
|
newnode.string = this.string;
|
||||||
@@ -226,9 +214,6 @@ final class FilterBeanNode extends FilterNode {
|
|||||||
this.byjoinColumn = beanNode.byjoinColumn;
|
this.byjoinColumn = beanNode.byjoinColumn;
|
||||||
this.foreignAttribute = beanNode.foreignAttribute;
|
this.foreignAttribute = beanNode.foreignAttribute;
|
||||||
this.columnAttribute = beanNode.columnAttribute;
|
this.columnAttribute = beanNode.columnAttribute;
|
||||||
this.array = beanNode.array;
|
|
||||||
this.collection = beanNode.collection;
|
|
||||||
this.ignoreCase = beanNode.ignoreCase;
|
|
||||||
this.least = beanNode.least;
|
this.least = beanNode.least;
|
||||||
this.number = beanNode.number;
|
this.number = beanNode.number;
|
||||||
this.string = beanNode.string;
|
this.string = beanNode.string;
|
||||||
@@ -238,10 +223,9 @@ final class FilterBeanNode extends FilterNode {
|
|||||||
@Override
|
@Override
|
||||||
protected <T> CharSequence createSQLJoin(final EntityInfo<T> info) {
|
protected <T> CharSequence createSQLJoin(final EntityInfo<T> info) {
|
||||||
if (joinSQL == null) return null;
|
if (joinSQL == null) return null;
|
||||||
return new StringBuilder(joinSQL);
|
return joinSQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected <T> Predicate<T> createPredicate(final EntityCache<T> cache, FilterBean bean) {
|
protected <T> Predicate<T> createPredicate(final EntityCache<T> cache, FilterBean bean) {
|
||||||
if (this.foreignEntity == null) return super.createPredicate(cache, bean);
|
if (this.foreignEntity == null) return super.createPredicate(cache, bean);
|
||||||
|
|||||||
Reference in New Issue
Block a user