use of org.hibernate.query.sqm.TrimSpec in project hibernate-orm by hibernate.
the class TrimFunction method render.
@Override
public void render(SqlAppender sqlAppender, List<? extends SqlAstNode> sqlAstArguments, SqlAstTranslator<?> walker) {
final TrimSpec specification = ((TrimSpecification) sqlAstArguments.get(0)).getSpecification();
final Object trimCharacter = ((Literal) sqlAstArguments.get(1)).getLiteralValue();
final Expression sourceExpr = (Expression) sqlAstArguments.get(2);
String trim = dialect.trimPattern(specification, (char) trimCharacter);
new PatternRenderer(trim).render(sqlAppender, Collections.singletonList(sourceExpr), walker);
}
Aggregations