@Test void substrSql() { when(expression1.sql(scope)).thenReturn("sql1"); when(expression2.sql(scope)).thenReturn("sql2"); when(scope.dialect()).thenReturn(dialect); when(dialect.function(StringFunctionSpecs.SUBSTR)).thenReturn(substrFunction); when(substrFunction.sql(scope, toArray("sql1", "sql2"))).thenReturn("substring(sql2, sql1)"); TypedExpression<String> sut = substr(expression1, expression2); String result = sut.sql(scope); assertThat(result, is("substring(sql2, sql1)")); verify(expression1).sql(scope); verify(expression2).sql(scope); verifyNoMoreInteractions(expression1, expression2); }
public static TypedExpression<String> substr(String str, int start) { return SqlFunction.of(SUBSTR, String.class, ValueExpression.of(str), ValueExpression.of(start)); }
StringFunctions extends UtilityClass { public static TypedExpression<String> substr(String str, int start) { return SqlFunction.of(SUBSTR, String.class, ValueExpression.of(str), ValueExpression.of(start)); } }
StringFunctions extends UtilityClass { public static TypedExpression<String> substr(String str, int start) { return SqlFunction.of(SUBSTR, String.class, ValueExpression.of(str), ValueExpression.of(start)); }  }
StringFunctions extends UtilityClass { public static TypedExpression<String> substr(String str, int start) { return SqlFunction.of(SUBSTR, String.class, ValueExpression.of(str), ValueExpression.of(start)); }  static TypedExpression<String> upper(String arg); static TypedExpression<String> upper(TypedExpression<String> arg); static TypedExpression<String> upper(Function1<R,String> arg); static TypedExpression<String> upper(FunctionOptional1<R,String> arg); static TypedExpression<String> upper(String alias, Function1<R,String> arg); static TypedExpression<String> upper(String alias, FunctionOptional1<R,String> arg); static TypedExpression<String> upper(Alias<R> alias, Function1<R,String> arg); static TypedExpression<String> upper(Alias<R> alias, FunctionOptional1<R,String> arg); static TypedExpression<String> lower(String arg); static TypedExpression<String> lower(TypedExpression<String> arg); static TypedExpression<String> lower(Function1<R,String> arg); static TypedExpression<String> lower(FunctionOptional1<R,String> arg); static TypedExpression<String> lower(String alias, Function1<R,String> arg); static TypedExpression<String> lower(String alias, FunctionOptional1<R,String> arg); static TypedExpression<String> lower(Alias<R> alias, Function1<R,String> arg); static TypedExpression<String> lower(Alias<R> alias, FunctionOptional1<R,String> arg); static TypedExpression<Integer> length(String arg); static TypedExpression<Integer> length(TypedExpression<String> arg); static TypedExpression<Integer> length(Function1<R,String> arg); static TypedExpression<Integer> length(FunctionOptional1<R,String> arg); static TypedExpression<Integer> length(String alias, Function1<R,String> arg); static TypedExpression<Integer> length(String alias, FunctionOptional1<R,String> arg); static TypedExpression<Integer> length(Alias<R> alias, Function1<R,String> arg); static TypedExpression<Integer> length(Alias<R> alias, FunctionOptional1<R,String> arg); static TypedExpression<String> substr(String str, int start); static TypedExpression<String> substr(TypedExpression<String> str, int start); static TypedExpression<String> substr(Function1<R,String> str, int start); static TypedExpression<String> substr(FunctionOptional1<R,String> str, int start); static TypedExpression<String> substr(String alias, Function1<R,String> str, int start); static TypedExpression<String> substr(String alias, FunctionOptional1<R,String> str, int start); static TypedExpression<String> substr(Alias<R> alias, Function1<R,String> str, int start); static TypedExpression<String> substr(Alias<R> alias, FunctionOptional1<R,String> str, int start); static TypedExpression<String> substr(TypedExpression<String> str, TypedExpression<Integer> start); static TypedExpression<String> substr(String str, int start, int len); static TypedExpression<String> substr(TypedExpression<String> str, int start, int len); static TypedExpression<String> substr(Function1<R,String> str, int start, int len); static TypedExpression<String> substr(FunctionOptional1<R,String> str, int start, int len); static TypedExpression<String> substr(String alias, Function1<R,String> str, int start, int len); static TypedExpression<String> substr(String alias, FunctionOptional1<R,String> str, int start, int len); static TypedExpression<String> substr(Alias<R> alias, Function1<R,String> str, int start, int len); static TypedExpression<String> substr(Alias<R> alias, FunctionOptional1<R,String> str, int start, int len); static TypedExpression<String> substr(TypedExpression<String> str, TypedExpression<Integer> start, TypedExpression<Integer> len); static TypedExpression<Integer> instr(String str, String substr); static TypedExpression<Integer> instr(TypedExpression<String> str, String substr); static TypedExpression<Integer> instr(Function1<R,String> str, String substr); static TypedExpression<Integer> instr(FunctionOptional1<R,String> str, String substr); static TypedExpression<Integer> instr(String alias, Function1<R,String> str, String substr); static TypedExpression<Integer> instr(String alias, FunctionOptional1<R,String> str, String substr); static TypedExpression<Integer> instr(Alias<R> alias, Function1<R,String> str, String substr); static TypedExpression<Integer> instr(Alias<R> alias, FunctionOptional1<R,String> str, String substr); static TypedExpression<Integer> instr(TypedExpression<String> str, TypedExpression<String> substr); }
StringFunctions extends UtilityClass { public static TypedExpression<String> substr(String str, int start) { return SqlFunction.of(SUBSTR, String.class, ValueExpression.of(str), ValueExpression.of(start)); }  static TypedExpression<String> upper(String arg); static TypedExpression<String> upper(TypedExpression<String> arg); static TypedExpression<String> upper(Function1<R,String> arg); static TypedExpression<String> upper(FunctionOptional1<R,String> arg); static TypedExpression<String> upper(String alias, Function1<R,String> arg); static TypedExpression<String> upper(String alias, FunctionOptional1<R,String> arg); static TypedExpression<String> upper(Alias<R> alias, Function1<R,String> arg); static TypedExpression<String> upper(Alias<R> alias, FunctionOptional1<R,String> arg); static TypedExpression<String> lower(String arg); static TypedExpression<String> lower(TypedExpression<String> arg); static TypedExpression<String> lower(Function1<R,String> arg); static TypedExpression<String> lower(FunctionOptional1<R,String> arg); static TypedExpression<String> lower(String alias, Function1<R,String> arg); static TypedExpression<String> lower(String alias, FunctionOptional1<R,String> arg); static TypedExpression<String> lower(Alias<R> alias, Function1<R,String> arg); static TypedExpression<String> lower(Alias<R> alias, FunctionOptional1<R,String> arg); static TypedExpression<Integer> length(String arg); static TypedExpression<Integer> length(TypedExpression<String> arg); static TypedExpression<Integer> length(Function1<R,String> arg); static TypedExpression<Integer> length(FunctionOptional1<R,String> arg); static TypedExpression<Integer> length(String alias, Function1<R,String> arg); static TypedExpression<Integer> length(String alias, FunctionOptional1<R,String> arg); static TypedExpression<Integer> length(Alias<R> alias, Function1<R,String> arg); static TypedExpression<Integer> length(Alias<R> alias, FunctionOptional1<R,String> arg); static TypedExpression<String> substr(String str, int start); static TypedExpression<String> substr(TypedExpression<String> str, int start); static TypedExpression<String> substr(Function1<R,String> str, int start); static TypedExpression<String> substr(FunctionOptional1<R,String> str, int start); static TypedExpression<String> substr(String alias, Function1<R,String> str, int start); static TypedExpression<String> substr(String alias, FunctionOptional1<R,String> str, int start); static TypedExpression<String> substr(Alias<R> alias, Function1<R,String> str, int start); static TypedExpression<String> substr(Alias<R> alias, FunctionOptional1<R,String> str, int start); static TypedExpression<String> substr(TypedExpression<String> str, TypedExpression<Integer> start); static TypedExpression<String> substr(String str, int start, int len); static TypedExpression<String> substr(TypedExpression<String> str, int start, int len); static TypedExpression<String> substr(Function1<R,String> str, int start, int len); static TypedExpression<String> substr(FunctionOptional1<R,String> str, int start, int len); static TypedExpression<String> substr(String alias, Function1<R,String> str, int start, int len); static TypedExpression<String> substr(String alias, FunctionOptional1<R,String> str, int start, int len); static TypedExpression<String> substr(Alias<R> alias, Function1<R,String> str, int start, int len); static TypedExpression<String> substr(Alias<R> alias, FunctionOptional1<R,String> str, int start, int len); static TypedExpression<String> substr(TypedExpression<String> str, TypedExpression<Integer> start, TypedExpression<Integer> len); static TypedExpression<Integer> instr(String str, String substr); static TypedExpression<Integer> instr(TypedExpression<String> str, String substr); static TypedExpression<Integer> instr(Function1<R,String> str, String substr); static TypedExpression<Integer> instr(FunctionOptional1<R,String> str, String substr); static TypedExpression<Integer> instr(String alias, Function1<R,String> str, String substr); static TypedExpression<Integer> instr(String alias, FunctionOptional1<R,String> str, String substr); static TypedExpression<Integer> instr(Alias<R> alias, Function1<R,String> str, String substr); static TypedExpression<Integer> instr(Alias<R> alias, FunctionOptional1<R,String> str, String substr); static TypedExpression<Integer> instr(TypedExpression<String> str, TypedExpression<String> substr);  }