diff --git a/src/site/markdown/dynamic-sql.md b/src/site/markdown/dynamic-sql.md index 4cc57aefac1..aa8a6fd928d 100644 --- a/src/site/markdown/dynamic-sql.md +++ b/src/site/markdown/dynamic-sql.md @@ -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 ``` - - ### 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. @@ -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 ... diff --git a/src/site/markdown/getting-started.md b/src/site/markdown/getting-started.md index fcd8abf8cc3..200e74fec69 100644 --- a/src/site/markdown/getting-started.md +++ b/src/site/markdown/getting-started.md @@ -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 = diff --git a/src/site/markdown/logging.md b/src/site/markdown/logging.md index 26e5b6016bd..aefa7bbb01a 100644 --- a/src/site/markdown/logging.md +++ b/src/site/markdown/logging.md @@ -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. @@ -68,8 +66,6 @@ If you use the maven, you can download jar files by adding following settings on ``` - - #### Step 2: Configure Logback Configuring Logback is simple. Suppose you want to enable the log for this mapper: @@ -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 + org.apache.logging.log4j log4j-core @@ -198,8 +192,6 @@ log4j2.xml ``` - - #### Configuration example for Log4j ```properties @@ -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 diff --git a/src/site/markdown/statement-builders.md b/src/site/markdown/statement-builders.md index 9e31a052f79..437c11d3549 100644 --- a/src/site/markdown/statement-builders.md +++ b/src/site/markdown/statement-builders.md @@ -619,6 +619,5 @@ private String selectPersonSql() { ORDER_BY("P.ID"); ORDER_BY("P.FULL_NAME"); return SQL(); -} - +} ```