
io.ebeaninternal.server.grammer.EqlWhereAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebean Show documentation
Show all versions of ebean Show documentation
composite of common runtime dependencies for all platforms
package io.ebeaninternal.server.grammer;
import io.ebean.ExpressionFactory;
import io.ebean.ExpressionList;
import io.ebeaninternal.server.util.ArrayStack;
class EqlWhereAdapter extends EqlWhereListener {
private final ExpressionList where;
private final ExpressionFactory expr;
private final Object[] params;
private int paramIndex;
EqlWhereAdapter(ExpressionList where, ExpressionFactory expr, Object[] params) {
this.where = where;
this.expr = expr;
this.params = params;
}
@Override
ExpressionList peekExprList() {
if (whereStack == null) {
whereStack = new ArrayStack<>();
whereStack.push(where);
}
return whereStack.peek();
}
@Override
ExpressionFactory expressionFactory() {
return expr;
}
@Override
Object positionParam(String paramPosition) {
if ("?".equals(paramPosition)) {
return params[paramIndex++];
}
final int pos = Integer.parseInt(paramPosition.substring(1));
return params[pos -1];
}
@Override
Object namedParam(String substring) {
throw new RuntimeException("Not supported");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy