Skip to content

Commit 17e9687

Browse files
authored
Merge pull request #796 from AnatoliiStepaniuk/master
few improvements for documentation
2 parents dcd0365 + 7f40414 commit 17e9687

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/site/xdoc/java-api.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,9 @@ try (SqlSession session = sqlSessionFactory.openSession()) {
287287
<p>While the various insert, update, delete and select methods above are powerful, they are also very verbose, not type safe and not as helpful to your IDE or unit tests as they could be. We've already seen an example of using Mappers in the Getting Started section above.</p>
288288
<p>Therefore, a more common way to execute mapped statements is to use Mapper classes. A mapper class is simply an interface with method definitions that match up against the SqlSession methods. The following example class demonstrates some method signatures and how they map to the SqlSession.</p>
289289
<source><![CDATA[public interface AuthorMapper {
290-
// (Author) selectOne("selectAuthor",5);
290+
// (Author) selectOne("selectAuthor", 5);
291291
Author selectAuthor(int id);
292-
// (List<Author>) selectList(selectAuthors)
292+
// (List<Author>) selectList("selectAuthors")
293293
List<Author> selectAuthors();
294294
// (Map<Integer,Author>) selectMap("selectAuthors", "id")
295295
@MapKey("id")
@@ -298,7 +298,7 @@ try (SqlSession session = sqlSessionFactory.openSession()) {
298298
int insertAuthor(Author author);
299299
// updateAuthor("updateAuthor", author)
300300
int updateAuthor(Author author);
301-
// delete("deleteAuthor",5)
301+
// delete("deleteAuthor", 5)
302302
int deleteAuthor(int id);
303303
}]]></source>
304304
<p>In a nutshell, each Mapper method signature should match that of the SqlSession method that it's associated to, but without the String parameter ID. Instead, the method name must match the mapped statement ID.</p>
@@ -574,7 +574,7 @@ User getUserById(Integer id);
574574
@Select("select * from company where id = #{id}")
575575
Company getCompanyById(Integer id);</source>
576576

577-
<p>This example shows solo parameter using the Sql Provider annotation:</p>
577+
<p>This example shows solo parameter using the SelectProvider annotation:</p>
578578
<source><![CDATA[@SelectProvider(type = UserSqlBuilder.class, method = "buildGetUsersByName")
579579
List<User> getUsersByName(String name);
580580

src/site/xdoc/statement-builders.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ String sql = "SELECT P.ID, P.USERNAME, P.PASSWORD, P.FULL_NAME, "
5252
</subsection>
5353
<subsection name="The Solution">
5454
<p>MyBatis 3 offers a convenient utility class to help with the problem.
55-
With the SQL class, you simply create an instance lets you call methods against it to build a SQL statement
55+
With the SQL class, you simply create an instance that lets you call methods against it to build a SQL statement
5656
one step at a time. The example problem above would look like this when rewritten with the SQL class:
5757
</p>
5858

0 commit comments

Comments
 (0)