org.hotrod.runtime.livesql.expressions.AliasedExpression Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hotrod-livesql Show documentation
Show all versions of hotrod-livesql Show documentation
HotRod is an ORM for Java, Spring and SpringBoot.
package org.hotrod.runtime.livesql.expressions;
import org.hotrod.runtime.livesql.queries.select.QueryWriter;
import org.hotrod.runtime.livesql.queries.select.ReferenceableExpression;
public class AliasedExpression implements ReferenceableExpression {
private Expression expression;
private String alias;
public AliasedExpression(final Expression expression, final String alias) {
this.expression = expression;
this.alias = alias;
}
@Override
public void renderTo(final QueryWriter w) {
this.expression.renderTo(w);
w.write(" as ");
w.write(w.getSqlDialect().getIdentifierRenderer().renderSQLName(this.alias));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy