#1100 - Refactor OrmQueryPlanKey to use string expression for where

This commit is contained in:
rob bygrave
2017-08-31 02:11:49 +12:00
parent a695fb59b2
commit f83c7fdac8
54 changed files with 359 additions and 723 deletions
@@ -1,7 +1,6 @@
package io.ebeaninternal.server.expression;
import io.ebean.LikeType;
import io.ebeaninternal.api.HashQueryPlanBuilder;
import io.ebeaninternal.api.SpiExpression;
import io.ebeaninternal.api.SpiExpressionRequest;
import io.ebeaninternal.server.el.ElPropertyValue;
@@ -63,9 +62,11 @@ class LikeExpression extends AbstractValueExpression {
* Based on caseInsensitive and the property name.
*/
@Override
public void queryPlanHash(HashQueryPlanBuilder builder) {
builder.add(LikeExpression.class).add(caseInsensitive).add(propName);
builder.bind(1);
public void queryPlanHash(StringBuilder builder) {
if (caseInsensitive){
builder.append("I");
}
builder.append("Like[").append(type).append(" ").append(propName).append("]");
}
@Override
@@ -73,18 +74,6 @@ class LikeExpression extends AbstractValueExpression {
return strValue().hashCode();
}
@Override
public boolean isSameByPlan(SpiExpression other) {
if (!(other instanceof LikeExpression)) {
return false;
}
LikeExpression that = (LikeExpression) other;
return this.propName.equals(that.propName)
&& this.caseInsensitive == that.caseInsensitive
&& this.type == that.type;
}
@Override
public boolean isSameByBind(SpiExpression other) {
LikeExpression that = (LikeExpression) other;