Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 2.0.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
pboonphong committed Mar 19, 2017
2 parents f329b14 + 9857c3c commit bb17bc8
Show file tree
Hide file tree
Showing 6 changed files with 421 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
<dependency>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-bmunit</artifactId>
<version>3.0.6</version>
<version>3.0.7</version>
<scope>test</scope>
</dependency>

Expand Down
41 changes: 38 additions & 3 deletions src/site/es/xdoc/batch.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2010-2016 the original author or authors.
Copyright 2010-2017 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,7 +42,7 @@

<subsection name="MyBatisPagingItemReader">
<p>
Este bean es un <code>IteamReader</code> que lee registros de una base de datos usando MyBatis de forma paginada.
Este bean es un <code>IteamReader</code> que lee registros de una base de datos usando paginación.
</p>

<p>
Expand All @@ -51,7 +51,7 @@
Al llamar al método <code>read()</code> éste devuelve el objeto que corresponde a la posición actual
y solicita más páginas si es necesario.

El reader pasa algunos parametros estándar y la SQL deberá hacer uso de algunos de ellos para construir un resultset
El reader recibe algunos parametros estándar y la SQL deberá hacer uso de algunos de ellos para construir un resultset
del tamaño requerido. Los parametros son:
</p>

Expand Down Expand Up @@ -118,6 +118,41 @@

</subsection>

<subsection name="MyBatisCursorItemReader">
<p>
Este bean es un <code>IteamReader</code> que lee registros de la base de datos usando un cursor.
</p>

<p>
<span class="label important">NOTA</span> Para usar este bean necesitas al menos MyBatis 3.4.0 o superior.
</p>

<p>
Ejecuta la sentencia especificada mediante la propiedad <code>setQueryId</code> para obtener los datos
usando el método <code>selectCursor()</code>.
Al llamar al método <code>read()</code> se devolverá el siguiente elemento del cursor
hasta que no quede ninguno por devolver.
</p>

<p>
El reader usa una conexión separada para que la sentencia no participe en ninguna transacción creada como parte
del proceso del step.
</p>

<p>Cuando se usar un cursor puedes usar una sentencia convencional:</p>
<source><![CDATA[<select id="getEmployee" resultMap="employeeBatchResult">
SELECT id, name, job FROM employees ORDER BY id ASC
</select>]]></source>

<p>A continuación se muestra un ejemplo de configuración:</p>

<source><![CDATA[<bean id="reader" class="org.mybatis.spring.batch.MyBatisCursorItemReader">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
<property name="queryId" value="getEmployee" />
</bean>]]></source>

</subsection>

<subsection name="MyBatisBatchItemWriter">

<p>
Expand Down
37 changes: 36 additions & 1 deletion src/site/ja/xdoc/batch.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2010-2016 the original author or authors.
Copyright 2010-2017 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -105,6 +105,41 @@

</subsection>

<subsection name="MyBatisCursorItemReader">
<p>
This bean is an <code>IteamReader</code> that reads records from a database using a cursor.
</p>

<p>
<span class="label important">NOTE</span> To use this bean you need at least MyBatis 3.4.0 or a newer version.
</p>

<p>
It executes the query specified as the <code>setQueryId</code> property to retrieve requested data
by using the method <code>selectCursor()</code>.
Each time a <code>read()</code> method is called it will return the next element of the cursor until no more
elements are left.
</p>

<p>
The reader will use a separate connection so the select statement does no participate in any transactions created
as part of the step processing.
</p>

<p>When using the cursor you can just execute a regular query:</p>
<source><![CDATA[<select id="getEmployee" resultMap="employeeBatchResult">
SELECT id, name, job FROM employees ORDER BY id ASC
</select>]]></source>

<p>Follows below a sample configuration snippet:</p>

<source><![CDATA[<bean id="reader" class="org.mybatis.spring.batch.MyBatisCursorItemReader">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
<property name="queryId" value="getEmployee" />
</bean>]]></source>

</subsection>

<subsection name="MyBatisBatchItemWriter">

<p>
Expand Down
37 changes: 36 additions & 1 deletion src/site/ko/xdoc/batch.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2010-2016 the original author or authors.
Copyright 2010-2017 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -101,6 +101,41 @@

</subsection>

<subsection name="MyBatisCursorItemReader">
<p>
This bean is an <code>IteamReader</code> that reads records from a database using a cursor.
</p>

<p>
<span class="label important">NOTE</span> To use this bean you need at least MyBatis 3.4.0 or a newer version.
</p>

<p>
It executes the query specified as the <code>setQueryId</code> property to retrieve requested data
by using the method <code>selectCursor()</code>.
Each time a <code>read()</code> method is called it will return the next element of the cursor until no more
elements are left.
</p>

<p>
The reader will use a separate connection so the select statement does no participate in any transactions created
as part of the step processing.
</p>

<p>When using the cursor you can just execute a regular query:</p>
<source><![CDATA[<select id="getEmployee" resultMap="employeeBatchResult">
SELECT id, name, job FROM employees ORDER BY id ASC
</select>]]></source>

<p>Follows below a sample configuration snippet:</p>

<source><![CDATA[<bean id="reader" class="org.mybatis.spring.batch.MyBatisCursorItemReader">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
<property name="queryId" value="getEmployee" />
</bean>]]></source>

</subsection>

<subsection name="MyBatisBatchItemWriter">

<p>모든 아이템을 배치로 구문을 일괄실행하기 위해 <code>SqlSessionTemplate</code>에서 배치로 작업을 처리하는 <code>ItemWriter</code>이다.
Expand Down
44 changes: 39 additions & 5 deletions src/site/xdoc/batch.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2010-2016 the original author or authors.
Copyright 2010-2017 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -28,9 +28,8 @@
<body>
<section name="Spring Batch">
<p>
As of version 1.1.0 MyBatis-Spring provides two beans for building Spring Batch applications: the <code>MyBatisPagingItemReader</code>
and the <code>MyBatisBatchItemWriter</code>. Both beans and this documentation are ports of their corresponding iBATIS 2.x versions
that are provided by default by in the Spring Batch bundle.
As of version 1.1.0 MyBatis-Spring provides three beans for building Spring Batch applications: the <code>MyBatisPagingItemReader</code>,
the <code>MyBatisCursorItemReader</code> and the <code>MyBatisBatchItemWriter</code>.
</p>

<p>
Expand All @@ -40,7 +39,7 @@

<subsection name="MyBatisPagingItemReader">
<p>
This bean is an <code>IteamReader</code> that reads records from a database using MyBatis in a paging fashion.
This bean is an <code>IteamReader</code> that reads records from a database in a paging fashion.
</p>

<p>
Expand Down Expand Up @@ -117,6 +116,41 @@

</subsection>

<subsection name="MyBatisCursorItemReader">
<p>
This bean is an <code>IteamReader</code> that reads records from a database using a cursor.
</p>

<p>
<span class="label important">NOTE</span> To use this bean you need at least MyBatis 3.4.0 or a newer version.
</p>

<p>
It executes the query specified as the <code>setQueryId</code> property to retrieve requested data
by using the method <code>selectCursor()</code>.
Each time a <code>read()</code> method is called it will return the next element of the cursor until no more
elements are left.
</p>

<p>
The reader will use a separate connection so the select statement does no participate in any transactions created
as part of the step processing.
</p>

<p>When using the cursor you can just execute a regular query:</p>
<source><![CDATA[<select id="getEmployee" resultMap="employeeBatchResult">
SELECT id, name, job FROM employees ORDER BY id ASC
</select>]]></source>

<p>Follows below a sample configuration snippet:</p>

<source><![CDATA[<bean id="reader" class="org.mybatis.spring.batch.MyBatisCursorItemReader">
<property name="sqlSessionFactory" ref="sqlSessionFactory" />
<property name="queryId" value="getEmployee" />
</bean>]]></source>

</subsection>

<subsection name="MyBatisBatchItemWriter">

<p>
Expand Down
Loading

0 comments on commit bb17bc8

Please sign in to comment.