From 6f63492a9113e55ff798b543a2feaca4a9c13c30 Mon Sep 17 00:00:00 2001 From: kamhung <22250530@qq.com> Date: Fri, 20 Nov 2015 15:54:58 +0800 Subject: [PATCH] --- .../wentch/redkale/source/FilterBeanNode.java | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/com/wentch/redkale/source/FilterBeanNode.java b/src/com/wentch/redkale/source/FilterBeanNode.java index 8b1a8ac79..69f57195e 100644 --- a/src/com/wentch/redkale/source/FilterBeanNode.java +++ b/src/com/wentch/redkale/source/FilterBeanNode.java @@ -155,18 +155,12 @@ final class FilterBeanNode extends FilterNode { private Attribute columnAttribute; - private boolean array; - - private boolean collection; + private long least; private boolean string; private boolean number; - private boolean ignoreCase; - - private long least; - protected FilterBeanNode(String col, boolean sign, Attribute beanAttr) { this.column = col; this.and = sign; @@ -177,15 +171,12 @@ final class FilterBeanNode extends FilterNode { final FilterColumn fc = field.getAnnotation(FilterColumn.class); if (fc != null && !fc.name().isEmpty()) this.column = fc.name(); final Class type = field.getType(); - this.array = type.isArray(); - this.collection = Collection.class.isAssignableFrom(type); 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.string = CharSequence.class.isAssignableFrom(type); 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 (AND != exp) exp = OR; } else { @@ -208,9 +199,6 @@ final class FilterBeanNode extends FilterNode { newnode.byjoinColumn = this.byjoinColumn; newnode.foreignAttribute = this.foreignAttribute; newnode.columnAttribute = this.columnAttribute; - newnode.array = this.array; - newnode.collection = this.collection; - newnode.ignoreCase = this.ignoreCase; newnode.least = this.least; newnode.number = this.number; newnode.string = this.string; @@ -226,9 +214,6 @@ final class FilterBeanNode extends FilterNode { this.byjoinColumn = beanNode.byjoinColumn; this.foreignAttribute = beanNode.foreignAttribute; this.columnAttribute = beanNode.columnAttribute; - this.array = beanNode.array; - this.collection = beanNode.collection; - this.ignoreCase = beanNode.ignoreCase; this.least = beanNode.least; this.number = beanNode.number; this.string = beanNode.string; @@ -238,10 +223,9 @@ final class FilterBeanNode extends FilterNode { @Override protected CharSequence createSQLJoin(final EntityInfo info) { if (joinSQL == null) return null; - return new StringBuilder(joinSQL); + return joinSQL; } - @Override protected Predicate createPredicate(final EntityCache cache, FilterBean bean) { if (this.foreignEntity == null) return super.createPredicate(cache, bean);