Search in sources :

Example 6 with Expression

use of org.springframework.data.relational.core.sql.Expression in project spring-data-jdbc by spring-projects.

the class ExpressionVisitorUnitTests method considerNamingStrategyForTableAsterisk.

// GH-1003
@Test
void considerNamingStrategyForTableAsterisk() {
    ExpressionVisitor visitor = new ExpressionVisitor(new SimpleRenderContext(NamingStrategies.toUpper()));
    Expression expression = Table.create("tab").asterisk();
    expression.visit(visitor);
    assertThat(visitor.getRenderedPart().toString()).isEqualTo("TAB.*");
}
Also used : Expression(org.springframework.data.relational.core.sql.Expression) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

Expression (org.springframework.data.relational.core.sql.Expression)6 Test (org.junit.jupiter.api.Test)5 Table (org.springframework.data.relational.core.sql.Table)4 ArrayList (java.util.ArrayList)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 PersistentPropertyPathExtension (org.springframework.data.relational.core.mapping.PersistentPropertyPathExtension)1 RelationalPersistentProperty (org.springframework.data.relational.core.mapping.RelationalPersistentProperty)1 Column (org.springframework.data.relational.core.sql.Column)1 SelectBuilder (org.springframework.data.relational.core.sql.SelectBuilder)1