use of org.springframework.data.relational.core.sql.TestJoin in project spring-data-jdbc by spring-projects.
the class JoinVisitorTestsUnitTest method renderJoins.
static List<Fixture> renderJoins() {
Column colOne = Column.create("colOne", Table.create("tabOne"));
Table tabTwo = Table.create("tabTwo");
Column colTwo = Column.create("colTwo", tabTwo);
Column renamed = colOne.as("renamed");
Select select = Select.builder().select(renamed).from(colOne.getTable()).build();
InlineQuery inlineQuery = InlineQuery.create(select, "inline");
return Arrays.asList(fixture("simple join", new TestJoin(Join.JoinType.JOIN, tabTwo, colOne.isEqualTo(colTwo)), "JOIN tabTwo ON tabOne.colOne = tabTwo.colTwo"), fixture("inlineQuery", new TestJoin(Join.JoinType.JOIN, inlineQuery, colTwo.isEqualTo(inlineQuery.column("renamed"))), "JOIN (SELECT tabOne.colOne AS renamed FROM tabOne) inline ON tabTwo.colTwo = inline.renamed"));
}
Aggregations