use of com.querydsl.core.types.Template in project querydsl by querydsl.
the class DialectSupport method createFunction.
public static SQLFunction createFunction(SQLTemplates templates, Operator operator) {
Template template = templates.getTemplate(operator);
Type type = HibernateUtil.getType(operator.getType());
return new SQLFunctionTemplate(type, convert(template));
}
use of com.querydsl.core.types.Template in project querydsl by querydsl.
the class DialectSupportTest method convert.
@Test
public void convert() {
Template trim = HSQLDBTemplates.DEFAULT.getTemplate(Ops.TRIM);
assertEquals("trim(both from ?1)", DialectSupport.convert(trim));
Template concat = HSQLDBTemplates.DEFAULT.getTemplate(Ops.CONCAT);
assertEquals("?1 || ?2", DialectSupport.convert(concat));
}
Aggregations