Skip to content

Commit ec49ba1

Browse files
committed
Polishing.
Fixes copyright dates of new files to the current year. Fixes the issue reference to use the GitHub notation. Adds an additional test to ensure that the `ConstantConditionVisitor` doesn't need a predicate. Original pull request #978
1 parent 5b5a7cd commit ec49ba1

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/ConstantCondition.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2021 the original author or authors.
2+
* Copyright 2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616
package org.springframework.data.relational.core.sql;
1717

1818
/**
19-
* {@link Condition} representing fixed sql statement
19+
* {@link Condition} representing fixed sql predicate.
2020
*
2121
* @author Daniele Canteri
2222
* @since 2.3

spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/ConstantConditionVisitor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2021 the original author or authors.
2+
* Copyright 2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.data.relational.core.sql.Column;
2323
import org.springframework.data.relational.core.sql.Conditions;
2424
import org.springframework.data.relational.core.sql.Functions;
25+
import org.springframework.data.relational.core.sql.SQL;
2526
import org.springframework.data.relational.core.sql.StatementBuilder;
2627
import org.springframework.data.relational.core.sql.Table;
2728

@@ -232,7 +233,7 @@ public void shouldRenderNotIn() {
232233
assertThat(sql).endsWith("WHERE my_table.left NOT IN (my_table.right)");
233234
}
234235

235-
@Test // DATAJDBC-907
236+
@Test // #907
236237
public void shouldRenderJust() {
237238

238239
String sql = SqlRenderer.toString(StatementBuilder.select(left).from(table)
@@ -241,4 +242,14 @@ public void shouldRenderJust() {
241242

242243
assertThat(sql).endsWith("WHERE sql");
243244
}
245+
246+
@Test // #907
247+
public void shouldRenderMultipleJust() {
248+
249+
String sql = SqlRenderer.toString(StatementBuilder.select(left).from(table)
250+
.where( Conditions.just("sql1").and(Conditions.just("sql2")))
251+
.build());
252+
253+
assertThat(sql).endsWith("WHERE sql1 AND sql2");
254+
}
244255
}

0 commit comments

Comments
 (0)