Skip to content

Commit 5950914

Browse files
committed
Remove trailing spaces
1 parent 9e1a0cc commit 5950914

21 files changed

+91
-91
lines changed

src/site/markdown/docs/complexQueries.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public SelectStatementProvider search(Integer targetId, String fName, String lNa
1919
var builder = select(id, firstName, lastName) // (1)
2020
.from(person)
2121
.where(); // (2)
22-
22+
2323
if (targetId != null) { // (3)
2424
builder
2525
.and(id, isEqualTo(targetId));
@@ -32,10 +32,10 @@ public SelectStatementProvider search(Integer targetId, String fName, String lNa
3232
builder
3333
.orderBy(lastName, firstName)
3434
.fetchFirst(50).rowsOnly(); // (7)
35-
35+
3636
return builder.build().render(RenderingStrategies.MYBATIS3); // (8)
3737
}
38-
38+
3939
public String addWildcards(String s) {
4040
return "%" + s + "%";
4141
}

src/site/markdown/docs/conditions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ List<Animal> search(String searchName) {
8080
.orderBy(id)
8181
.build()
8282
.render(RenderingStrategies.MYBATIS3);
83-
83+
8484
...
8585
}
8686
```
@@ -97,7 +97,7 @@ List<Animal> search(String searchName){
9797
.build()
9898
.render(RenderingStrategies.MYBATIS3);
9999
}
100-
100+
101101
String appendWildCards(String in) {
102102
return "%" + in + "%";
103103
}
@@ -144,7 +144,7 @@ If all three values are null, then no where clause will be generated.
144144
Each of the conditions accepts a lambda expression that can be used to determine if the condition should render or not.
145145
The lambdas will all be of standard JDK types (either `java.util.function.BooleanSupplier`,
146146
`java.util.function.Predicate`, or `java.util.function.BiPredicate` depending on the type of condition). The following
147-
table lists the optional conditions and shows how to use them:
147+
table lists the optional conditions and shows how to use them:
148148

149149
| Condition | Example | Rendering Rules |
150150
|-----------|---------|-----------------|
@@ -197,7 +197,7 @@ Optionality with the "in" and "not in" conditions is a bit more complex than the
197197
thing to know is that no "in" or "not in" condition will render if the list of values is empty. For example, there
198198
will never be rendered SQL like `where name in ()`. So optionality of the "in" conditions is more about optionality
199199
of the *values* of the condition. The library comes with functions that will filter out null values, and will upper
200-
case String values to enable case insensitive queries. There are extension points to add additional filtering and
200+
case String values to enable case insensitive queries. There are extension points to add additional filtering and
201201
mapping if you so desire.
202202

203203
The following table shows the different supplied In conditions and how they will render for different sets of inputs.
@@ -218,7 +218,7 @@ The table assumes the following types of input:
218218
| IsNotInCaseInsensitive | No | Yes | upper(name) not in ('FOO', null, 'BAR') | upper(name) not in (null) |
219219
| IsNotInCaseInsensitiveWhenPresent | Yes | Yes | upper(name) not in ('FOO', 'BAR') | No Render |
220220

221-
If none of these options meet your needs, the "In" conditions also support "map" and "filter" methods for the values.
221+
If none of these options meet your needs, the "In" conditions also support "map" and "filter" methods for the values.
222222
This gives you great flexibility to alter or filter the value list before the condition
223223
is rendered.
224224

src/site/markdown/docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The configuration file is a standard Java properties file. The possible values a
3131
## Statement Configuration
3232

3333
If the global configuration is not acceptable for any individual statement, you can also configure the statement in the
34-
DSL. Consider the following statement:
34+
DSL. Consider the following statement:
3535

3636
```java
3737
DeleteStatementProvider deleteStatement = deleteFrom(animalData)
@@ -52,7 +52,7 @@ The Kotlin DSL contains the same function:
5252
```kotlin
5353
val deleteStatement = deleteFrom(person) {
5454
where { id isEqualToWhenPresent null }
55-
configureStatement { isNonRenderingWhereClauseAllowed = true }
55+
configureStatement { isNonRenderingWhereClauseAllowed = true }
5656
}
5757
```
5858

src/site/markdown/docs/delete.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ For example:
1616
DeleteStatementProvider deleteStatement = deleteFrom(foo)
1717
.build()
1818
.render(RenderingStrategies.MYBATIS3);
19-
```
19+
```
2020

2121
## Annotated Mapper for Delete Statements
2222

2323
The DeleteStatementProvider object can be used as a parameter to a MyBatis mapper method directly. If you
2424
are using an annotated mapper, the delete method should look like this:
25-
25+
2626
```java
2727
import org.apache.ibatis.annotations.DeleteProvider;
2828
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
@@ -41,7 +41,7 @@ We do not recommend using an XML mapper for delete statements, but if you want t
4141
object can be used as a parameter to a MyBatis mapper method directly.
4242

4343
If you are using an XML mapper, the delete method should look like this in the Java interface:
44-
44+
4545
```java
4646
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
4747

src/site/markdown/docs/exceptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ All of these exceptions can be avoided through proper use of the DSL and validat
3030
Most conditions in a where clause provide optionality - they have `filter` methods that can cause the condition to be
3131
dropped from the where clause. If all the conditions in a where clause fail to render, then the where clause itself is
3232
dropped from the rendered SQL. This can be dangerous in that it can cause a statement to be generated that affects all
33-
rows in a table. For example, all rows could be deleted. As of version 1.4.1, the library will throw a
33+
rows in a table. For example, all rows could be deleted. As of version 1.4.1, the library will throw a
3434
`NonRenderingWhereClauseException` in this case out of an abundance of caution. This behavior can be overridden
3535
through either global configuration, or by configuring individual statements to allow for where clauses to be dropped.
3636

src/site/markdown/docs/extending.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A calculated column can be used anywhere in a SELECT statement. If you don't ne
2020

2121
```java
2222
public class CountAll implements BasicColumn {
23-
23+
2424
private String alias;
2525

2626
public CountAll() {
@@ -100,7 +100,7 @@ public class ToBase64 extends AbstractTypeConvertingFunction<byte[], String, ToB
100100
protected ToBase64 copy() {
101101
return new ToBase64(column);
102102
}
103-
103+
104104
public static ToBase64 toBase64(BindableColumn<byte[]> column) {
105105
return new ToBase64(column);
106106
}
@@ -113,7 +113,7 @@ The following function implements the common database `UPPER()` function.
113113

114114
```java
115115
public class Upper extends AbstractUniTypeFunction<String, Upper> {
116-
116+
117117
private Upper(BindableColumn<String> column) {
118118
super(column);
119119
}

src/site/markdown/docs/howItWorks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ templating engine for generating dynamic SQL.
1313
For example, MyBatis can execute an SQL string formatted like this:
1414

1515
```sql
16-
select id, description from table_codes where id = #{id,jdbcType=INTEGER}
16+
select id, description from table_codes where id = #{id,jdbcType=INTEGER}
1717
```
1818

1919
This is standard SQL with a MyBatis twist - the parameter notation `#{id,jdbcType=INTEGER}`
@@ -36,11 +36,11 @@ public class Parameter {
3636
public Parameter(Integer id) {
3737
this.id = id;
3838
}
39-
39+
4040
public Integer getId() {
4141
return id;
4242
}
43-
43+
4444
public String getSql() {
4545
return sql;
4646
}

src/site/markdown/docs/insert.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The library will generate a variety of INSERT statements:
55
1. An insert for multiple rows with a single statement
66
1. An insert for multiple rows with a JDBC batch
77
1. A general insert statement
8-
1. An insert with a select statement
8+
1. An insert with a select statement
99

1010
## Single Row Insert
1111
A single record insert is a statement that inserts a single record into a table. This statement is configured differently than other statements in the library so that MyBatis' support for generated keys will work properly. To use the statement, you must first create an object that will map to the database row, then map object attributes to fields in the database. For example:
@@ -42,7 +42,7 @@ Notice the `map` method. It is used to map a database column to an attribute of
4242
3. `map(column).toStringConstant(constant_value)` will insert a constant into a column. The constant_value will be written into the generated insert statement surrounded by single quote marks (as an SQL String)
4343
4. `map(column).toProperty(property)` will insert a value from the record into a column. The value of the property will be bound to the SQL statement as a prepared statement parameter
4444
5. `map(column).toPropertyWhenPresent(property, Supplier<?> valueSupplier)` will insert a value from the record into a column if the value is non-null. The value of the property will be bound to the SQL statement as a prepared statement parameter. This is used to generate a "selective" insert as defined in MyBatis Generator.
45-
6. `map(column).toRow()` will insert the record itself into a column. This is appropriate when the "record" is a simple class like Integer or String.
45+
6. `map(column).toRow()` will insert the record itself into a column. This is appropriate when the "record" is a simple class like Integer or String.
4646

4747
### Annotated Mapper for Single Row Insert Statements
4848
The InsertStatementProvider object can be used as a parameter to a MyBatis mapper method directly. If you
@@ -64,7 +64,7 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
6464
We do not recommend using an XML mapper for insert statements, but if you want to do so the InsertStatementProvider object can be used as a parameter to a MyBatis mapper method directly.
6565

6666
If you are using an XML mapper, the insert method should look like this in the Java interface:
67-
67+
6868
```java
6969
import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider;
7070

@@ -110,15 +110,15 @@ A multiple row insert statement looks like this:
110110
try (SqlSession session = sqlSessionFactory.openSession()) {
111111
GeneratedAlwaysAnnotatedMapper mapper = session.getMapper(GeneratedAlwaysAnnotatedMapper.class);
112112
List<GeneratedAlwaysRecord> records = getRecordsToInsert(); // not shown
113-
113+
114114
MultiRowInsertStatementProvider<GeneratedAlwaysRecord> multiRowInsert = insertMultiple(records)
115115
.into(generatedAlways)
116116
.map(id).toProperty("id")
117117
.map(firstName).toProperty("firstName")
118118
.map(lastName).toProperty("lastName")
119119
.build()
120120
.render(RenderingStrategies.MYBATIS3);
121-
121+
122122
int rows = mapper.insertMultiple(multiRowInsert);
123123
}
124124
```
@@ -143,7 +143,7 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
143143
We do not recommend using an XML mapper for insert statements, but if you want to do so the MultiRowInsertStatementProvider object can be used as a parameter to a MyBatis mapper method directly.
144144

145145
If you are using an XML mapper, the insert method should look like this in the Java interface:
146-
146+
147147
```java
148148
import org.mybatis.dynamic.sql.insert.render.MultiInsertStatementProvider;
149149

@@ -189,7 +189,7 @@ that we expect generated values. Further, note that the `keyProperty` is set to
189189
return the `insertStatement` as supplied in the method call. The adapter method requires that there be one, and only
190190
one, String parameter in the method call, and it assumes that this one String parameter is the SQL insert statement.
191191
The parameter can have any name and can be specified in any position in the method's parameter list.
192-
The `@Param` annotation is not required for the insert statement. However, it may be specified if you so desire.
192+
The `@Param` annotation is not required for the insert statement. However, it may be specified if you so desire.
193193

194194
The second method above decomposes the `MultiRowInsertStatementProvider` and calls the first method.
195195

@@ -222,7 +222,7 @@ A batch insert is a collection of statements that can be used to execute a JDBC
222222

223223
It is important to open a MyBatis session by setting the executor type to BATCH. The records are inserted on the commit. You can call commit multiple times if you want to do intermediate commits.
224224

225-
Notice that the same mapper method that is used to insert a single record is now executed multiple times. The `map` methods are the same with the exception that the `toPropertyWhenPresent` mapping is not supported for batch inserts.
225+
Notice that the same mapper method that is used to insert a single record is now executed multiple times. The `map` methods are the same with the exception that the `toPropertyWhenPresent` mapping is not supported for batch inserts.
226226

227227
## General Insert Statement
228228
A general insert is used to build arbitrary insert statements. The general insert does not require a separate record object to hold values for the statement - any value can be passed into the statement. This version of the insert is not convenient for retrieving generated keys with MyBatis - for that use case we recommend the "single record insert". However the general insert is perfectly acceptable for Spring JDBC template or MyBatis inserts that do not return generated keys. For example
@@ -265,7 +265,7 @@ import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
265265
We do not recommend using an XML mapper for insert statements, but if you want to do so the GeneralInsertStatementProvider object can be used as a parameter to a MyBatis mapper method directly.
266266

267267
If you are using an XML mapper, the insert method should look like this in the Java interface:
268-
268+
269269
```java
270270
import org.mybatis.dynamic.sql.insert.render.GeneralInsertStatementProvider;
271271

@@ -299,7 +299,7 @@ An insert select is an SQL insert statement the inserts the results of a select
299299

300300
int rows = mapper.insertSelect(insertSelectStatement);
301301
```
302-
The column list is optional and can be removed if the selected columns match the layout of the table.
302+
The column list is optional and can be removed if the selected columns match the layout of the table.
303303

304304
### Annotated Mapper for Insert Select Statements
305305
The InsertSelectStatementProvider object can be used as a parameter to a MyBatis mapper method directly. If you
@@ -322,7 +322,7 @@ Note that MyBatis does not support overloaded mapper method names, so the name o
322322
We do not recommend using an XML mapper for insert statements, but if you want to do so the InsertSelectStatementProvider object can be used as a parameter to a MyBatis mapper method directly.
323323

324324
If you are using an XML mapper, the insert method should look like this in the Java interface:
325-
325+
326326
```java
327327
import org.mybatis.dynamic.sql.insert.render.InsertSelectStatementProvider;
328328

src/site/markdown/docs/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ The primary goals of the library are:
3333
3. Flexible - where clauses can be built using any combination of and, or, and nested conditions
3434
4. Extensible - the library will render statements for MyBatis3, Spring JDBC templates or plain JDBC.
3535
It can be extended to generate clauses for other frameworks as well. Custom where conditions can
36-
be added easily if none of the built in conditions are sufficient for your needs.
36+
be added easily if none of the built in conditions are sufficient for your needs.
3737
5. Small - the library is a small dependency to add. It has no transitive dependencies.
38-
38+
3939
This library grew out of a desire to create a utility that could be used to improve the code
4040
generated by MyBatis Generator, but the library can be used on its own with very little setup required.

src/site/markdown/docs/kotlinMyBatis3.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The extension methods will reuse the abstract methods and add functionality to m
115115
execute the SQL statements in a one-step process. The extension methods shown below assume that you will create
116116
a set of CRUD methods for each table you are accessing (as is the case with code created by MyBatis Generator).
117117

118-
If you create a Kotlin mapper interface that includes both abstract and non-abstract methods, MyBatis will
118+
If you create a Kotlin mapper interface that includes both abstract and non-abstract methods, MyBatis will
119119
throw errors. By default, Kotlin does not create Java default methods in an interface. For this reason, Kotlin
120120
mapper interfaces should only contain the actual MyBatis mapper abstract interface methods. What would normally be coded
121121
as default or static methods in a Java mapper interface should be coded as extension methods in Kotlin. For example,
@@ -556,7 +556,7 @@ val rows = mapper.insertMultiple(record1, record2)
556556

557557
### Generated Key Support
558558

559-
Multi-row insert statements support returning a generated key using normal MyBatis generated key support. However,
559+
Multi-row insert statements support returning a generated key using normal MyBatis generated key support. However,
560560
generated keys require some care for multi-row insert statements. In this section we will show how to use the
561561
library's built-in support. When generated keys are expected you must code the mapper method manually and supply the
562562
`@Options` annotation that configures generated key support. You cannot use the built-in base interface when there are
@@ -606,7 +606,7 @@ import org.apache.ibatis.executor.BatchResult
606606
interface PersonMapper {
607607
@InsertProvider(type = SqlProviderAdapter::class, method = "insert")
608608
fun insert(insertStatement: InsertStatementProvider<PersonRecord>): Int
609-
609+
610610
@Flush
611611
fun flush(): List<BatchResult>
612612
}
@@ -838,7 +838,7 @@ distinct can be executed with the `selectMany` method.
838838
### One-Step Method
839839
You can use built-in utility functions to create mapper extension functions that simplify execution of select statements.
840840
The extension functions will reuse the abstract methods and supply the table and column list for the statement.
841-
We recommend three extension methods for select multiple records, select multiple records with the distinct keyword,
841+
We recommend three extension methods for select multiple records, select multiple records with the distinct keyword,
842842
and selecting a single record:
843843

844844
```kotlin
@@ -1024,7 +1024,7 @@ It is also possible to write utility methods that will set values. For example:
10241024
fun KotlinUpdateBuilder.updateSelectiveColumns(record: PersonRecord) =
10251025
apply {
10261026
set(id) equalToWhenPresent record::id
1027-
set(firstName) equalToWhenPresent record::firstName
1027+
set(firstName) equalToWhenPresent record::firstName
10281028
set(lastName) equalToWhenPresent record::lastName
10291029
set(birthDate) equalToWhenPresent record::birthDate
10301030
set(employed) equalToWhenPresent record::employed

0 commit comments

Comments
 (0)