com.avaje.ebeaninternal.server.expression.AllEqualsExpression Maven / Gradle / Ivy
package com.avaje.ebeaninternal.server.expression;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import com.avaje.ebean.event.BeanQueryRequest;
import com.avaje.ebeaninternal.api.ManyWhereJoins;
import com.avaje.ebeaninternal.api.SpiExpression;
import com.avaje.ebeaninternal.api.SpiExpressionRequest;
import com.avaje.ebeaninternal.api.SpiLuceneExpr;
import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;
import com.avaje.ebeaninternal.server.el.ElPropertyDeploy;
import com.avaje.ebeaninternal.server.query.LuceneResolvableRequest;
class AllEqualsExpression implements SpiExpression {
private static final long serialVersionUID = -8691773558205937025L;
private final Map propMap;
private final FilterExprPath pathPrefix;
AllEqualsExpression(FilterExprPath pathPrefix, Map propMap) {
this.pathPrefix = pathPrefix;
this.propMap = propMap;
}
public boolean isLuceneResolvable(LuceneResolvableRequest req) {
return false;
}
public SpiLuceneExpr createLuceneExpr(SpiExpressionRequest request) {
return null;
}
protected String name(String propName) {
if (pathPrefix == null){
return propName;
} else {
String path = pathPrefix.getPath();
if (path == null || path.length() == 0){
return propName;
} else {
return path+"."+propName;
}
}
}
public void containsMany(BeanDescriptor> desc, ManyWhereJoins manyWhereJoin) {
if (propMap != null){
Iterator it = propMap.keySet().iterator();
while (it.hasNext()) {
String propertyName = it.next();
ElPropertyDeploy elProp = desc.getElPropertyDeploy(name(propertyName));
if (elProp != null && elProp.containsMany()){
manyWhereJoin.add(elProp);
}
}
}
}
public void addBindValues(SpiExpressionRequest request) {
if (propMap.isEmpty()) {
return;
}
Iterator
© 2015 - 2025 Weber Informatics LLC | Privacy Policy