
io.ebeaninternal.server.grammer.EqlAdapterHelper 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.ExpressionList;
import io.ebean.LikeType;
import java.math.BigDecimal;
import java.util.List;
class EqlAdapterHelper {
private final EqlAdapter> owner;
public EqlAdapterHelper(EqlAdapter> owner) {
this.owner = owner;
}
enum ValueType {
NAMED_PARAM,
STRING,
BOOL,
NUMBER
}
private ValueType getValueType(String valueAsText) {
char firstChar = Character.toLowerCase(valueAsText.charAt(0));
switch (firstChar) {
case ':':
return ValueType.NAMED_PARAM;
case 't':
return ValueType.BOOL;
case 'f':
return ValueType.BOOL;
case '\'':
return ValueType.STRING;
default:
if (Character.isDigit(firstChar)) {
return ValueType.NUMBER;
}
throw new IllegalArgumentException("Unexpected first character in value [" + valueAsText + "]");
}
}
protected void addBetweenProperty(String rawValue, String lowProperty, String highProperty) {
peekExprList().betweenProperties(lowProperty, highProperty, bind(rawValue));
}
protected void addBetween(String path, String value1, String value2) {
peekExprList().between(path, bind(value1), bind(value2));
}
protected void addInRange(String path, String value1, String value2) {
peekExprList().inRange(path, bind(value1), bind(value2));
}
protected void addIn(String path, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy