QCompiler implements OQLLexerTokenTypes { CompiledValue createCompiledValueForLikePredicate(CompiledValue var, CompiledValue patternOrBindParam) { if (!(patternOrBindParam.getType() == CompiledBindArgument.QUERY_PARAM)) { CompiledLiteral pattern = (CompiledLiteral) patternOrBindParam; if (pattern._obj == null) { throw new UnsupportedOperationException( "Null values are not supported with LIKE predicate."); } } return new CompiledLike(var, patternOrBindParam); } QCompiler();  QCompiler(boolean isForIndexCompilation); CompiledValue compileQuery(String oqlSource); List compileFromClause(String fromClause); List compileProjectionAttributes(String projectionAttributes); void compileOrederByClause(int numOfChildren); void compileGroupByClause(int numOfChildren); void compileSortCriteria(String sortCriterion); void compileLimit(String limitNum); void compileImports(String imports); void select(Map<Integer, Object> queryComponents); void projection(); void aggregateFunction(CompiledValue expr, int aggFuncType, boolean distinctOnly); void iteratorDef(); void undefinedExpr(boolean is_defined); void function(int function, int numOfChildren); void inExpr(); void constructObject(Class clazz); void pushId(String id); void pushRegion(String regionPath); void appendPathComponent(String id); void pushBindArgument(int i); void pushLiteral(Object obj); void pushNull(); void combine(int num); void methodInvocation(); void indexOp(); void like(); void compare(int opKind); void mod(); void arithmetic(int opKind); void or(int numTerms); void and(int numTerms); void not(); void unaryMinus(); void typecast(); ObjectType assembleType(); void traceRequest(); boolean isTraceRequested(); void setHint(int numOfChildren); void setHintIdentifier(String text); void importName(String qualifiedName, String asName); Object pop(); void push(Object obj); int stackSize(); ObjectType resolveType(String typeName);  }
@Ignore @Test public void testStringConditioningForLike_2() { CompiledValue var = new CompiledPath(new CompiledID("p"), "ID"); String s1 = "abc%"; CompiledLiteral literal = new CompiledLiteral(s1); QCompiler compiler = new QCompiler(); CompiledValue result = compiler.createCompiledValueForLikePredicate(var, literal); validationHelperForCompiledJunction((CompiledJunction) result, "abc", "abd"); s1 = "abc\\\\%"; literal = new CompiledLiteral(s1); compiler = new QCompiler(); result = compiler.createCompiledValueForLikePredicate(var, literal); validationHelperForCompiledJunction((CompiledJunction) result, "abc\\\\", "abc\\]"); s1 = "abc" + new String(new char[] {(char) 255, '%'}); literal = new CompiledLiteral(s1); compiler = new QCompiler(); result = compiler.createCompiledValueForLikePredicate(var, literal); String lowerBoundKey = "abc" + new String(new char[] {(char) 255}); validationHelperForCompiledJunction((CompiledJunction) result, lowerBoundKey, "abd"); s1 = "abc" + new String(new char[] {(char) 255, (char) 255, (char) 255, (char) 255, (char) 255, '%'}); literal = new CompiledLiteral(s1); compiler = new QCompiler(); result = compiler.createCompiledValueForLikePredicate(var, literal); lowerBoundKey = "abc" + new String(new char[] {(char) 255, (char) 255, (char) 255, (char) 255, (char) 255}); validationHelperForCompiledJunction((CompiledJunction) result, lowerBoundKey, "abd"); s1 = "%"; literal = new CompiledLiteral(s1); compiler = new QCompiler(); result = compiler.createCompiledValueForLikePredicate(var, literal); assertThat(result).isInstanceOf(CompiledComparison.class); CompiledComparison cc = (CompiledComparison) result; assertThat(cc.reflectOnOperator((CompiledValue) cc.getChildren().get(1))) .isEqualTo(OQLLexerTokenTypes.TOK_GE); assertThat(((CompiledLiteral) cc.getChildren().get(1))._obj).isEqualTo(""); }