Skip to content

Commit

Permalink
fix typos[skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
awxiaoxian2020 committed Feb 5, 2023
1 parent 563045f commit 1a6011f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 20 deletions.
8 changes: 2 additions & 6 deletions src/site/markdown/dynamic-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ The Dynamic SQL elements should be familiar to anyone who has used JSTL or any s
- trim (where, set)
- foreach



### if

The most common thing to do in dynamic SQL is conditionally include a part of a where clause. For example:

```
```xml
<select id="findActiveBlogWithTitleLike"
resultType="Blog">
SELECT * FROM BLOG
Expand Down Expand Up @@ -69,8 +67,6 @@ Let’s use the example above, but now let’s search only on title if one is pr
</select>
```



### trim, where, set

The previous examples have been conveniently dancing around a notorious dynamic SQL challenge. Consider what would happen if we return to our "if" example, but this time we make "ACTIVE = 1" a dynamic condition as well.
Expand Down Expand Up @@ -160,7 +156,7 @@ Here, the *set* element will dynamically prepend the SET keyword, and also elimi

Alternatively, you can achieve the same effect by using *trim* element:

```
```xml
<trim prefix="SET" suffixOverrides=",">
...
</trim>
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Every MyBatis application centers around an instance of SqlSessionFactory. A Sql

Building a SqlSessionFactory instance from an XML file is very simple. It is recommended that you use a classpath resource for this configuration, but you could use any InputStream instance, including one created from a literal file path or a file:// URL. MyBatis includes a utility class, called Resources, that contains a number of methods that make it simpler to load resources from the classpath and other locations.

```
```java
String resource = "org/mybatis/example/mybatis-config.xml";
InputStream inputStream = Resources.getResourceAsStream(resource);
SqlSessionFactory sqlSessionFactory =
Expand Down
12 changes: 1 addition & 11 deletions src/site/markdown/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ To see MyBatis logging statements you may enable logging on a package, a mapper

Again, how you do this is dependent on the logging implementation in use. We'll show how to do it with SLF4J(Logback). Configuring the logging services is simply a matter of including one or more extra configuration files (e.g. `logback.xml`) and sometimes a new JAR file. The following example configuration will configure full logging services using SLF4J(Logback) as a provider. There are 2 steps.



#### Step 1: Add the SLF4J + Logback JAR files

Because we are using SLF4J(Logback), we will need to ensure its JAR file is available to our application. To use SLF4J(Logback), you need to add the JAR file to your application classpath.
Expand All @@ -68,8 +66,6 @@ If you use the maven, you can download jar files by adding following settings on
</dependency>
```



#### Step 2: Configure Logback

Configuring Logback is simple. Suppose you want to enable the log for this mapper:
Expand Down Expand Up @@ -167,12 +163,10 @@ Yes, as you may have noticed, there is no difference in configuring logging for

The remaining configuration in the `logback.xml` file is used to configure the appenders, which is beyond the scope of this document. However, you can find more information at the [Logback](https://logback.qos.ch/) website. Or, you could simply experiment with it to see what effects the different configuration options have.



#### Configuration example for Log4j 2

```xml
pom.xml
<!-- pom.xml -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
Expand All @@ -198,8 +192,6 @@ log4j2.xml
</Configuration>
```



#### Configuration example for Log4j

```properties
Expand All @@ -219,8 +211,6 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
```



#### Configuration example for JDK logging

```properties
Expand Down
3 changes: 1 addition & 2 deletions src/site/markdown/statement-builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,5 @@ private String selectPersonSql() {
ORDER_BY("P.ID");
ORDER_BY("P.FULL_NAME");
return SQL();
}

}
```

0 comments on commit 1a6011f

Please sign in to comment.