Skip to content

Commit 520134d

Browse files
schaudermp911de
authored andcommitted
Conditions with SimpleExpressions get properly rendered.
This commit contains just a test to verify this. The actual fix happened as part of #1018. Closes #1009. Original pull request #1015 See #1018
1 parent 9844f40 commit 520134d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

spring-data-relational/src/test/java/org/springframework/data/relational/core/sql/render/SelectRendererUnitTests.java

+15
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,21 @@ void shouldRenderArbitraryJoinCondition() {
176176
+ "OR employee.tenant != department.tenant");
177177
}
178178

179+
@Test // GH-1009
180+
public void shouldRenderJoinWithJustExpression() {
181+
182+
Table employee = SQL.table("employee");
183+
Table department = SQL.table("department");
184+
185+
Select select = Select.builder().select(employee.column("id"), department.column("name")).from(employee) //
186+
.join(department)
187+
.on(Expressions.just("alpha")).equals(Expressions.just("beta")) //
188+
.build();
189+
190+
assertThat(SqlRenderer.toString(select)).isEqualTo("SELECT employee.id, department.name FROM employee "
191+
+ "JOIN department ON alpha = beta");
192+
}
193+
179194
@Test // DATAJDBC-309
180195
void shouldRenderMultipleJoinWithAnd() {
181196

0 commit comments

Comments
 (0)