Skip to content

Commit e1f7237

Browse files
restore site configuration
1 parent a15edfa commit e1f7237

File tree

5 files changed

+24
-51
lines changed

5 files changed

+24
-51
lines changed

pom.xml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -400,38 +400,11 @@
400400
</execution>
401401
</executions>
402402
</plugin>
403-
<plugin>
404-
<groupId>org.apache.maven.plugins</groupId>
405-
<artifactId>maven-resources-plugin</artifactId>
406-
<executions>
407-
<!-- prepare site content by filtering ${project.*} values-->
408-
<execution>
409-
<id>filter-site</id>
410-
<phase>pre-site</phase>
411-
<goals>
412-
<goal>copy-resources</goal>
413-
</goals>
414-
<configuration>
415-
<outputDirectory>${project.build.directory}/site-src</outputDirectory>
416-
<resources>
417-
<resource>
418-
<directory>src/site</directory>
419-
<filtering>true</filtering>
420-
</resource>
421-
</resources>
422-
</configuration>
423-
</execution>
424-
</executions>
425-
<configuration>
426-
<escapeString>\</escapeString>
427-
</configuration>
428-
</plugin>
429403
<plugin>
430404
<groupId>org.apache.maven.plugins</groupId>
431405
<artifactId>maven-site-plugin</artifactId>
432406
<configuration>
433407
<locales>en,es,ja,fr,zh_CN,ko</locales>
434-
<siteDirectory>${project.build.directory}/site-src</siteDirectory>
435408
</configuration>
436409
</plugin>
437410
<plugin>

src/site/markdown/configuration.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ The properties can then be used throughout the configuration files to substitute
3434

3535
```xml
3636
<dataSource type="POOLED">
37-
<property name="driver" value="\${driver}"/>
38-
<property name="url" value="\${url}"/>
39-
<property name="username" value="\${username}"/>
40-
<property name="password" value="\${password}"/>
37+
<property name="driver" value="${driver}"/>
38+
<property name="url" value="${url}"/>
39+
<property name="username" value="${username}"/>
40+
<property name="password" value="${password}"/>
4141
</dataSource>
4242
```
4343

@@ -68,7 +68,7 @@ Since the MyBatis 3.4.2, your can specify a default value into placeholder as fo
6868
```xml
6969
<dataSource type="POOLED">
7070
<!-- ... -->
71-
<property name="username" value="\${username:ut_user}"/> <!-- If 'username' property not present, username become 'ut_user' -->
71+
<property name="username" value="${username:ut_user}"/> <!-- If 'username' property not present, username become 'ut_user' -->
7272
</dataSource>
7373
```
7474

@@ -81,7 +81,7 @@ This feature is disabled by default. If you specify a default value into placeho
8181
</properties>
8282
```
8383

84-
<span class="label important">NOTE</span> This will conflict with the `":"` character in property keys (e.g. `db:username`) or the ternary operator of OGNL expressions (e.g. `\${tableName != null ? tableName : 'global_constants'}`) on a SQL definition. If you use either and want default property values, you must change the default value separator by adding this special property:
84+
<span class="label important">NOTE</span> This will conflict with the `":"` character in property keys (e.g. `db:username`) or the ternary operator of OGNL expressions (e.g. `${tableName != null ? tableName : 'global_constants'}`) on a SQL definition. If you use either and want default property values, you must change the default value separator by adding this special property:
8585

8686
```xml
8787
<properties resource="org/mybatis/example/config.properties">
@@ -93,7 +93,7 @@ This feature is disabled by default. If you specify a default value into placeho
9393
```xml
9494
<dataSource type="POOLED">
9595
<!-- ... -->
96-
<property name="username" value="\${db:username?:ut_user}"/>
96+
<property name="username" value="${db:username?:ut_user}"/>
9797
</dataSource>
9898
```
9999

@@ -562,10 +562,10 @@ The environments element defines how the environment is configured.
562562
<property name="..." value="..."/>
563563
</transactionManager>
564564
<dataSource type="POOLED">
565-
<property name="driver" value="\${driver}"/>
566-
<property name="url" value="\${url}"/>
567-
<property name="username" value="\${username}"/>
568-
<property name="password" value="\${password}"/>
565+
<property name="driver" value="${driver}"/>
566+
<property name="url" value="${url}"/>
567+
<property name="username" value="${username}"/>
568+
<property name="password" value="${password}"/>
569569
</dataSource>
570570
</environment>
571571
</environments>

src/site/markdown/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you are using Maven just add the following dependency to your pom.xml:
1313
<dependency>
1414
<groupId>org.mybatis</groupId>
1515
<artifactId>mybatis</artifactId>
16-
<version>${project.version}</version>
16+
<version>x.x.x</version>
1717
</dependency>
1818
```
1919

@@ -42,10 +42,10 @@ The configuration XML file contains settings for the core of the MyBatis system,
4242
<environment id="development">
4343
<transactionManager type="JDBC"/>
4444
<dataSource type="POOLED">
45-
<property name="driver" value="\${driver}"/>
46-
<property name="url" value="\${url}"/>
47-
<property name="username" value="\${username}"/>
48-
<property name="password" value="\${password}"/>
45+
<property name="driver" value="${driver}"/>
46+
<property name="url" value="${url}"/>
47+
<property name="username" value="${username}"/>
48+
<property name="password" value="${password}"/>
4949
</dataSource>
5050
</environment>
5151
</environments>

src/site/markdown/java-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The first four methods are the most common, as they take an InputStream instance
8383

8484
If you call a build method that takes the environment parameter, then MyBatis will use the configuration for that environment. Of course, if you specify an invalid environment, you will receive an error. If you call one of the build methods that does not take the environment parameter, then the default environment is used (which is specified as default="development" in the example above).
8585

86-
If you call a method that takes a properties instance, then MyBatis will load those properties and make them available to your configuration. Those properties can be used in place of most values in the configuration using the syntax: \${propName}
86+
If you call a method that takes a properties instance, then MyBatis will load those properties and make them available to your configuration. Those properties can be used in place of most values in the configuration using the syntax: ${propName}
8787

8888
Recall that properties can also be referenced from the mybatis-config.xml file, or specified directly within it. Therefore it's important to understand the priority. We mentioned it earlier in this document, but here it is again for easy reference:
8989

src/site/markdown/sqlmap-xml.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ As an irregular case, some databases allow INSERT, UPDATE or DELETE statement to
228228
This element can be used to define a reusable fragment of SQL code that can be included in other statements. It can be statically (during load phase) parametrized. Different property values can vary in include instances. For example:
229229

230230
```xml
231-
<sql id="userColumns"> \${alias}.id,\${alias}.username,\${alias}.password </sql>
231+
<sql id="userColumns"> ${alias}.id,${alias}.username,${alias}.password </sql>
232232
```
233233

234234
The SQL fragment can then be included in another statement, for example:
@@ -247,12 +247,12 @@ Property value can be also used in include refid attribute or property values in
247247

248248
```xml
249249
<sql id="sometable">
250-
\${prefix}Table
250+
${prefix}Table
251251
</sql>
252252

253253
<sql id="someinclude">
254254
from
255-
<include refid="\${include_target}"/>
255+
<include refid="${include_target}"/>
256256
</sql>
257257

258258
<select id="select" resultType="map">
@@ -339,7 +339,7 @@ Despite all of these powerful options, most of the time you'll simply specify th
339339
By default, using the `#{}` syntax will cause MyBatis to generate `PreparedStatement` properties and set the values safely against the `PreparedStatement` parameters (e.g. ?). While this is safer, faster and almost always preferred, sometimes you just want to directly inject an unmodified string into the SQL Statement. For example, for ORDER BY, you might use something like this:
340340

341341
```sql
342-
ORDER BY \${columnName}
342+
ORDER BY ${columnName}
343343
```
344344

345345
Here MyBatis won't modify or escape the string.
@@ -362,11 +362,11 @@ User findByEmail(@Param("email") String email);
362362
you can just write:
363363

364364
```java
365-
@Select("select * from user where \${column} = #{value}")
365+
@Select("select * from user where ${column} = #{value}")
366366
User findByColumn(@Param("column") String column, @Param("value") String value);
367367
```
368368

369-
in which the `\${column}` will be substituted directly and the `#{value}` will be "prepared". Thus you can just do the same work by:
369+
in which the `${column}` will be substituted directly and the `#{value}` will be "prepared". Thus you can just do the same work by:
370370

371371
```java
372372
User userOfId1 = userMapper.findByColumn("id", 1L);
@@ -1265,7 +1265,7 @@ To configure your cache, simply add public JavaBeans properties to your Cache im
12651265
</cache>
12661266
```
12671267

1268-
You can use JavaBeans properties of all simple types, MyBatis will do the conversion. And you can specify a placeholder(e.g. `\${cache.file}`) to replace value defined at [configuration properties](configuration.html#properties).
1268+
You can use JavaBeans properties of all simple types, MyBatis will do the conversion. And you can specify a placeholder(e.g. `${cache.file}`) to replace value defined at [configuration properties](configuration.html#properties).
12691269

12701270
Since 3.4.2, the MyBatis has been supported to call an initialization method after it's set all properties. If you want to use this feature, please implements the `org.apache.ibatis.builder.InitializingObject` interface on your custom cache class.
12711271

0 commit comments

Comments
 (0)