Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Chinese documentation #297

Merged
merged 20 commits into from Apr 24, 2018

Conversation

Projects
None yet
2 participants
@CodeingBoy
Copy link
Contributor

commented Apr 23, 2018

Reading MyBatis-Spring Chinese documentation is not a pleasant thing, because there's a lot misunderstanding words. So I did a lot of changes to improve the documentation quality. Feel free to merge.

@CodeingBoy

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2018

Two questions:

  1. File "getting-started.xml.vm" seems not a valid file format, so I renamed it to "getting-started.xml", is it OK?
  2. In chapter "Spring Batch", there's a sentence:
queryId: If the base code have several tables or databases to read from, and that you have different queries, it might be interesting to use different mapper files with different namespaces. so when referring to the query, don't forget about the namespace of the mapper file.

Since I don't have any Spring Batch background. I can't understand it well. Is that means I could using several mappers with different namespaces in a MyBatisPagingItemReader, or just because the application may contains several mappers, for not having naming conflict, we should write the mapper namespace in queryId?

@kazuki43zoo

This comment has been minimized.

Copy link
Member

commented Apr 23, 2018

File "getting-started.xml.vm" seems not a valid file format, so I renamed it to "getting-started.xml", is it OK?

No. You should keep a file name. See https://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Filtering.

@kazuki43zoo

This comment has been minimized.

Copy link
Member

commented Apr 23, 2018

In chapter "Spring Batch", there's a sentence: ...

If short statement id is unique, you can specify a short statement id.

e.g.)

<mapper namespace="a.b.c.FooMapper">
    <select id="findPage" ...>
        // ....
    </select>
</mapper>
<bean id="reader" class="org.mybatis.spring.batch.MyBatisPagingItemReader">
  <property name="sqlSessionFactory" ref="sqlSessionFactory" />
  <property name="queryId" value="findPage" /> <!-- Can specify a short statement id -->
</bean>

But if short statement id is not unique, you need to specify a full statement id(namespace + short statement id).

e.g.)

<mapper namespace="a.b.c.BarMapper">
    <select id="findPage" ...> <!-- Same short statement id with FooMapper -->
        // ....
    </select>
</mapper>
<bean id="reader" class="org.mybatis.spring.batch.MyBatisPagingItemReader">
  <property name="sqlSessionFactory" ref="sqlSessionFactory" />
  <property name="queryId" value="a.b.c.FooMapper.findPage" /> <!-- Need to specify a full statement id -->
</bean>

Probably, I guess it explains the above specification.

@CodeingBoy CodeingBoy force-pushed the CodeingBoy:master branch from af1e1cf to fdd32e6 Apr 23, 2018

@CodeingBoy

This comment has been minimized.

Copy link
Contributor Author

commented Apr 23, 2018

Got it. Thanks. I pushed commits reverting file renaming as well as adding some additional changes(including adding above explanation about queryId). Now you can merge it. :)

@kazuki43zoo kazuki43zoo merged commit c30149a into mybatis:master Apr 24, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kazuki43zoo

This comment has been minimized.

Copy link
Member

commented Apr 24, 2018

@CodeingBoy Thanks your working!

@kazuki43zoo kazuki43zoo added this to the 2.0.0 milestone Apr 24, 2018

@kazuki43zoo kazuki43zoo requested review from kazuki43zoo and removed request for kazuki43zoo Jan 8, 2019

@kazuki43zoo kazuki43zoo self-assigned this Jan 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.