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
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2021 the original author or authors.
|
||||
* Copyright 2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,7 +16,7 @@
|
||||
package org.springframework.data.relational.core.sql;
|
||||
|
||||
/**
|
||||
* {@link Condition} representing fixed sql statement
|
||||
* {@link Condition} representing fixed sql predicate.
|
||||
*
|
||||
* @author Daniele Canteri
|
||||
* @since 2.3
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2021 the original author or authors.
|
||||
* Copyright 2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.data.relational.core.sql.Column;
|
||||
import org.springframework.data.relational.core.sql.Conditions;
|
||||
import org.springframework.data.relational.core.sql.Functions;
|
||||
import org.springframework.data.relational.core.sql.SQL;
|
||||
import org.springframework.data.relational.core.sql.StatementBuilder;
|
||||
import org.springframework.data.relational.core.sql.Table;
|
||||
|
||||
@@ -232,7 +233,7 @@ public class ConditionRendererUnitTests {
|
||||
assertThat(sql).endsWith("WHERE my_table.left NOT IN (my_table.right)");
|
||||
}
|
||||
|
||||
@Test // DATAJDBC-907
|
||||
@Test // #907
|
||||
public void shouldRenderJust() {
|
||||
|
||||
String sql = SqlRenderer.toString(StatementBuilder.select(left).from(table)
|
||||
@@ -241,4 +242,14 @@ public class ConditionRendererUnitTests {
|
||||
|
||||
assertThat(sql).endsWith("WHERE sql");
|
||||
}
|
||||
|
||||
@Test // #907
|
||||
public void shouldRenderMultipleJust() {
|
||||
|
||||
String sql = SqlRenderer.toString(StatementBuilder.select(left).from(table)
|
||||
.where( Conditions.just("sql1").and(Conditions.just("sql2")))
|
||||
.build());
|
||||
|
||||
assertThat(sql).endsWith("WHERE sql1 AND sql2");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user