use of org.springframework.data.relational.core.sql.Column in project spring-data-jdbc by spring-projects.
the class ExpressionVisitorUnitTests method renderAliasedExpressionWithAliasHandlingUse.
// GH-1003
@Test
void renderAliasedExpressionWithAliasHandlingUse() {
ExpressionVisitor visitor = new ExpressionVisitor(simpleRenderContext, ExpressionVisitor.AliasHandling.USE);
Column expression = Column.aliased("col", Table.create("tab"), "col_alias");
expression.visit(visitor);
assertThat(visitor.getRenderedPart().toString()).isEqualTo("col_alias");
}
use of org.springframework.data.relational.core.sql.Column in project spring-data-jdbc by spring-projects.
the class ExpressionVisitorUnitTests method renderAliasedExpressionWithAliasHandlingDeclare.
// GH-1003
@Test
void renderAliasedExpressionWithAliasHandlingDeclare() {
ExpressionVisitor visitor = new ExpressionVisitor(simpleRenderContext, ExpressionVisitor.AliasHandling.IGNORE);
Column expression = Column.aliased("col", Table.create("tab"), "col_alias");
expression.visit(visitor);
assertThat(visitor.getRenderedPart().toString()).isEqualTo("tab.col");
}
Aggregations