Refactor of query plan hash - add HashQueryPlan, HashQuery etc

This commit is contained in:
Rob Bygrave
2014-01-21 00:48:38 +13:00
parent 6bd8c2bd05
commit f287205421
36 changed files with 499 additions and 300 deletions
@@ -1,6 +1,7 @@
package com.avaje.ebeaninternal.server.expression;
import com.avaje.ebean.event.BeanQueryRequest;
import com.avaje.ebeaninternal.api.HashQueryPlanBuilder;
import com.avaje.ebeaninternal.api.SpiExpressionRequest;
import com.avaje.ebeaninternal.server.el.ElPropertyValue;
@@ -41,15 +42,12 @@ class NullExpression extends AbstractExpression {
/**
* Based on notNull flag and the propertyName.
*/
public int queryAutoFetchHash() {
int hc = NullExpression.class.getName().hashCode();
hc = hc * 31 + (notNull ? 1 : 0);
hc = hc * 31 + propName.hashCode();
return hc;
public void queryAutoFetchHash(HashQueryPlanBuilder builder) {
builder.add(NullExpression.class).add(notNull).add(propName);
}
public int queryPlanHash(BeanQueryRequest<?> request) {
return queryAutoFetchHash();
public void queryPlanHash(BeanQueryRequest<?> request, HashQueryPlanBuilder builder) {
queryAutoFetchHash(builder);
}
public int queryBindHash() {