mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1100 - Refactor OrmQueryPlanKey to use string expression for where
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user