Skip to content

Commit 0ae18b8

Browse files
committed
Doc improvements merged into 3.2.x branch
1 parent 7a6e401 commit 0ae18b8

24 files changed

+553
-1290
lines changed

src/site/es/xdoc/configuration.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
131131
true | false
132132
</td>
133133
<td>
134-
true
134+
false
135135
</td>
136136
</tr>
137137
<tr>

src/site/es/xdoc/logging.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ org.apache.ibatis.logging.LogFactory.useStdOutLogging();]]></source>
9090
<a href="http://java.sun.com/j2se/1.4.1/docs/guide/util/logging/">JDK Logging API</a>
9191
</li>
9292
</ul>
93-
<subsection name="Logging Configuration">
93+
<subsection name="Configuración">
9494
<p>Para ver el log de las sentencias debes activar el log en un paquete, el nombre plenamente cualificado de una clase, un namespace o un nombre plenamente cualificado de un mapped statement.</p>
95-
<p>Nuevamente, como hagas esto es dependiente de la implementación de logging que se esté usando. Mostraremos cómo hacerlo con Log4j. Configurar los servicios de logging es simplemente cuestión de añadir uno o varios ficheros de configuración (por ejemplo log4j.properties) y a veces un nuevo JAR (por ejemplo log4j.jar). El ejemplo siguiente configura todos los servicios de logging para que usen log4j como proveedor. Sólo son dos pasos:
95+
<p>Nuevamente, cómo hagas esto es dependiente de la implementación de logging que se esté usando. Mostraremos cómo hacerlo con Log4j. Configurar los servicios de logging es simplemente cuestión de añadir uno o varios ficheros de configuración (por ejemplo log4j.properties) y a veces un nuevo JAR (por ejemplo log4j.jar). El ejemplo siguiente configura todos los servicios de logging para que usen log4j como proveedor. Sólo son dos pasos:
9696
</p>
97-
<h4>Paso 1: Añade el fichero Log4J JAR
97+
<h4>Paso 1: Añade el fichero Log4j JAR
9898
</h4>
9999
<p>Dado que usamos Log4j, necesitaremos asegurarnos que el fichero JAR está disponible para nuestra aplicación. Para usar Log4j, necesitas añadir el fichero JAR al classpath de tu aplicación. Puedes descargar Log4j desde la URL indicada más arriba.
100100
</p>
101101
<p>En aplicaciones Web o de empresa debes añadir tu fichero log4j.java a tu directorio WEB-INF/lib, y en una aplicación standalone simplemente añádela al parámetro –classpath de la JVM.
102102
</p>
103103
<h4>
104-
Paso 2: Configurar Log4J
104+
Paso 2: Configurar Log4j
105105
</h4>
106106
<p>Configurar Log4j es sencillo. Supongamos que quieres habilitar el log para este mapper:</p>
107107
<source><![CDATA[package org.mybatis.example;

src/site/es/xdoc/statement-builders.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public String deletePersonSql() {
9494
// Builder / Fluent style
9595
public String insertPersonSql() {
9696
String sql = new SQL()
97-
.INSERT_INTO("PERSON");
98-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
97+
.INSERT_INTO("PERSON")
98+
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
9999
.VALUES("LAST_NAME", "${lastName}")
100100
.toString();
101101
return sql;

src/site/ja/xdoc/configuration.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
144144
true | false
145145
</td>
146146
<td>
147-
true
147+
false
148148
</td>
149149
</tr>
150150
<tr>

src/site/ja/xdoc/statement-builders.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public String deletePersonSql() {
100100
// メソッドチェーン(Builder / Fluent スタイル)
101101
public String insertPersonSql() {
102102
String sql = new SQL()
103-
.INSERT_INTO("PERSON");
104-
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}");
103+
.INSERT_INTO("PERSON")
104+
.VALUES("ID, FIRST_NAME", "${id}, ${firstName}")
105105
.VALUES("LAST_NAME", "${lastName}")
106106
.toString();
107107
return sql;

src/site/ko/xdoc/configuration.xml

Lines changed: 46 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,14 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
115115
lazyLoadingEnabled
116116
</td>
117117
<td>
118-
늦은 로딩을 사용할지에 대한 여부. 사용하지 않는다면 모두 즉시 로딩할 것이다.
119-
This value can be superseded for an specific relation by using the <code>fetchType</code> attribute on it.
118+
늦은 로딩을 사용할지에 대한 여부. 사용하지 않는다면 모두 즉시 로딩할 것이다.
119+
이 값은 <code>fetchType</code> 속성을 사용해서 대체할 수 있다.
120120
</td>
121121
<td>
122122
true | false
123123
</td>
124124
<td>
125-
true
125+
false
126126
</td>
127127
</tr>
128128
<tr>
@@ -242,9 +242,9 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
242242
localCacheScope
243243
</td>
244244
<td>
245-
MyBatis uses local cache to prevent circular references and speed up repeated nested queries.
246-
By default (SESSION) all queries executed during a session are cached. If localCacheScope=STATEMENT local session will be used just for
247-
statement execution, no data will be shared between two different calls to the same SqlSession.
245+
마이바티스는 순환참조를 막거나 반복된 쿼리의 속도를 높히기 위해 로컬캐시를 사용한다.
246+
디폴트 설정인 SESSION을 사용해서 동일 세션의 모든 쿼리를 캐시한다.
247+
localCacheScope=STATEMENT 로 설정하면 로컬 세션은 구문 실행할때만 사용하고 같은 SqlSession에서 두개의 다른 호출사이에는 데이터를 공유하지 않는다.
248248
</td>
249249
<td>
250250
SESSION | STATEMENT
@@ -258,11 +258,11 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
258258
jdbcTypeForNull
259259
</td>
260260
<td>
261-
Specifies the JDBC type for null values when no specific JDBC type was provided for the parameter.
262-
Some drivers require specifying the column JDBC type but others work with generic values like NULL, VARCHAR or OTHER.
261+
JDBC타입을 파라미터에 제공하지 않을때 null값을 처리한 JDBC타입을 명시한다.
262+
일부 드라이버는 칼럼의 JDBC타입을 정의하도록 요구하지만 대부분은 NULL, VARCHAR 나 OTHER 처럼 일반적인 값을 사용해서 동작한다.
263263
</td>
264264
<td>
265-
JdbcType enumeration. Most common are: NULL, VARCHAR and OTHER
265+
JdbcType 이늄. 대부분은 NULL, VARCHAR OTHER 를 공통적으로 사용한다.
266266
</td>
267267
<td>
268268
OTHER
@@ -273,10 +273,10 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
273273
lazyLoadTriggerMethods
274274
</td>
275275
<td>
276-
Specifies which Object's methods trigger a lazy load
276+
늦은 로딩을 야기하는 객체의 메소드를 명시
277277
</td>
278278
<td>
279-
A method name list separated by commas
279+
메소드 이름을 나열하고 여러개일 경우 콤마(,) 로 구분
280280
</td>
281281
<td>
282282
equals,clone,hashCode,toString
@@ -287,10 +287,10 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
287287
defaultScriptingLanguage
288288
</td>
289289
<td>
290-
Specifies the language used by default for dynamic SQL generation.
290+
동적으로 SQL을 만들기 위해 기본적으로 사용하는 언어를 명시
291291
</td>
292292
<td>
293-
A type alias or fully qualified class name.
293+
타입별칭이나 패키지 경로를 포함한 클래스명
294294
</td>
295295
<td>
296296
org.apache.ibatis.scripting.xmltags.XMLDynamicLanguageDriver
@@ -301,7 +301,9 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
301301
callSettersOnNulls
302302
</td>
303303
<td>
304-
Specifies if setters or map's put method will be called when a retrieved value is null. It is useful when you rely on Map.keySet() or null value initialization. Note primitives such as (int,boolean,etc.) will not be set to null.
304+
가져온 값이 null일때 setter나 맵의 put 메소드를 호출할지를 명시
305+
Map.keySet() 이나 null값을 초기화할때 유용하다.
306+
int, boolean 등과 같은 원시타입은 null을 셋팅할 수 없다는 점은 알아두면 좋다.
305307
</td>
306308
<td>
307309
true | false
@@ -315,35 +317,36 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
315317
logPrefix
316318
</td>
317319
<td>
318-
Specifies the prefix string that MyBatis will add to the logger names.
320+
마이바티스가 로거(logger) 이름에 추가할 접두사 문자열을 명시
319321
</td>
320322
<td>
321-
Any String
323+
문자열
322324
</td>
323325
<td>
324-
Not set
326+
셋팅하지 않음
325327
</td>
326328
</tr>
327329
<tr>
328330
<td>
329331
logImpl
330332
</td>
331333
<td>
332-
Specifies which logging implementation MyBatis should use. If this setting is not present logging implementation will be autodiscovered.
334+
마이바티스가 사용할 로깅 구현체를 명시
335+
이 설정을 사용하지 않으면 마이바티스가 사용할 로깅 구현체를 자동으로 찾는다.
333336
</td>
334337
<td>
335338
SLF4J | LOG4J | LOG4J2 | JDK_LOGGING | COMMONS_LOGGING | STDOUT_LOGGING | NO_LOGGING
336339
</td>
337340
<td>
338-
Not set
341+
셋팅하지 않음
339342
</td>
340343
</tr>
341344
<tr>
342345
<td>
343346
proxyFactory
344347
</td>
345348
<td>
346-
Specifies the proxy tool that MyBatis will use for creating lazy loading capable objects.
349+
마이바티스가 늦은 로딩을 처리할 객체를 생성할 때 사용할 프록시 툴을 명시
347350
</td>
348351
<td>
349352
CGLIB | JAVASSIST
@@ -945,9 +948,8 @@ public class ExampleTypeHandler extends BaseTypeHandler<String> {
945948

946949
<p>JDBC타입에 대한 자동검색 기능은 애노테이션을 명시한 경우에만 가능하다는 것을 알아둘 필요가 있다. </p>
947950
<p>
948-
You can create a generic TypeHandler that is able to handle more than one class. For that purpose
949-
add a constructor that receives the class as a parameter and MyBatis will pass the actual class when
950-
constructing the TypeHandler.
951+
한개 이상의 클래스를 다루는 제네릭 TypeHandler를 만들수 있다.
952+
파라미터로 클래스를 가져오는 생성자를 추가하고 마이바티스는 TypeHandler를 만들때 실제 클래스를 전달할 것이다.
951953
</p>
952954

953955
<source><![CDATA[//GenericTypeHandler.java
@@ -962,51 +964,43 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
962964
...
963965
]]></source>
964966

965-
<p><code>EnumTypeHandler</code> and <code>EnumOrdinalTypeHandler</code> are generic TypeHandlers. We will learn
966-
about them in the following section.
967+
<p><code>EnumTypeHandler</code> <code>EnumOrdinalTypeHandler</code> 는 제네릭 TypeHandler이다.
968+
이어서 각각을 다룬다.
967969
</p>
968970

969971
</subsection>
970972

971973
<subsection name="Handling Enums">
972974
<p>
973-
If you want to map an <code>Enum</code>, you'll need to use either
974-
<code>EnumTypeHandler</code> or <code>EnumOrdinalTypeHandler</code>.
975+
<code>Enum</code>을 매핑하고자 한다면 <code>EnumTypeHandler</code> 나 <code>EnumOrdinalTypeHandler</code> 를 사용할 필요가 있을것이다.
975976
</p>
976977

977-
<p>For example, let's say that we need to store the rounding mode that
978-
should be used with some number if it needs to be rounded. By default, MyBatis
979-
uses <code>EnumTypeHandler</code> to convert the <code>Enum</code>
980-
values to their names.
978+
<p>예를들어, 순환 방식으로 몇개의 숫자를 사용하는 순환모드를 저장할 필요가 있다고 해보자.
979+
기본적으로 마이바티스는 <code>Enum</code> 값을 각각의 이름으로 변환하기 위해 <code>EnumTypeHandler</code> 를 사용한다.
981980
</p>
982981

983-
<b>Note <code>EnumTypeHandler</code> is special in the sense that unlike other handlers,
984-
it does not handle just one specific class, but any class that extends <code>Enum</code></b>
982+
<b><code>EnumTypeHandler</code>는 특히 다른 핸들러와 차이가 있다.
983+
어떤 하나의 특정 클래스를 다루지 않고 <code>Enum</code> 을 확장하는 모든 클래스를 다룬다. </b>
985984

986-
<p>However, we may not want to store names. Our DBA may insist on an
987-
integer code instead. That's just as easy: add <code>EnumOrdinalTypeHandler</code>
988-
to the <code>typeHandlers</code> in your config file, and now each
989-
<code>RoundingMode</code> will be mapped to an integer using its ordinal value.
985+
<p>아무리 이름을 저장하려해도 DBA는 숫자코드를 고집할수 있다. 이름대신 숫자코드를 저장하는 방법은 쉽다.
986+
설정파일의 <code>typeHandlers</code>에 <code>EnumOrdinalTypeHandler</code> 를 추가하자.
987+
그러면 각각의 <code>RoundingMode</code>는 순서값을 사용해서 숫자를 매핑할 것이다.
990988
</p>
991989
<source><![CDATA[<!-- mybatis-config.xml -->
992990
<typeHandlers>
993991
<typeHandler handler="org.apache.ibatis.type.EnumOrdinalTypeHandler" javaType="java.math.RoundingMode"/>
994992
</typeHandlers>
995993
]]></source>
996994
<p>
997-
But what if you want to map the same <code>Enum</code> to a
998-
string in one place and to integer in another?
995+
같은 <code>Enum</code>을 사용해서 어떤곳에는 문자열로 매핑하고 다른곳에는 숫자로 매핑해야 한다면 무엇을 해야 하나?
999996
</p>
1000997
<p>
1001-
The auto-mapper will automatically use <code>EnumOrdinalTypeHandler</code>,
1002-
so if we want to go back to using plain old ordinary
1003-
<code>EnumTypeHandler</code>, we have to tell it, by explicitly setting
1004-
the type handler to use for those SQL statements.
998+
자동매퍼는 <code>EnumOrdinalTypeHandler</code> 를 자동으로 사용할 것이다.
999+
그래서 평범한 순서를 나타내는 <code>EnumTypeHandler</code> 를 사용하고자 한다면 SQL구문에 사용할 타입핸들러를 몀시적으로 설정한다.
10051000
</p>
10061001
<p>
1007-
(Mapper files aren't covered until the next section, so if this is your first
1008-
time reading through the documentation, you may want to skip this for now
1009-
and come back to it later.)
1002+
(매퍼 파일은 다음절까지는 다루지 않는다.
1003+
그래서 문서를 보면서 처음 봤다면 일단 이부분은 건너띄고 다음에 다시 볼수도 있다. )
10101004
</p>
10111005
<source><![CDATA[<!DOCTYPE mapper
10121006
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
@@ -1051,8 +1045,7 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
10511045
</mapper>
10521046
]]></source>
10531047
<p>
1054-
Note that this forces us to use a <code>resultMap</code>
1055-
instead of a <code>resultType</code> in our select statements.
1048+
여기서 사용한 select구문에서는 <code>resultType</code> 대신에 <code>resultMap</code>을 사용해야 한다는 점을 알아두자.
10561049
</p>
10571050
</subsection>
10581051

@@ -1296,7 +1289,7 @@ data_source 프로퍼티가 InitialContext 에서 직접 찾을 것이다.</li>
12961289
<p>이 설정은 인스턴스화할 때 InitialContext 생성자에 “encoding” 프로퍼티를 “UTF8” 로 전달한다.</p>
12971290

12981291
<p>
1299-
You can plug any 3rd party DataSource by implementing the interface <code>org.apache.ibatis.datasource.DataSourceFactory</code>:
1292+
<code>org.apache.ibatis.datasource.DataSourceFactory</code> 인터페이스를 구현해서 또다른 DataSource구현체를 만들수 있다.
13001293
</p>
13011294

13021295
<source><![CDATA[public interface DataSourceFactory {
@@ -1305,8 +1298,8 @@ data_source 프로퍼티가 InitialContext 에서 직접 찾을 것이다.</li>
13051298
}]]></source>
13061299

13071300
<p>
1308-
<code>org.apache.ibatis.datasource.unpooled.UnpooledDataSourceFactory</code> can be used as super class
1309-
class to build new datasource adapters. For example this is the code needed to plug C3P0:
1301+
<code>org.apache.ibatis.datasource.unpooled.UnpooledDataSourceFactory</code> 는 새로운 데이터소스를 만들기 위한 상위 클래스처럼 사용할 수 있다.
1302+
예를들면 다음의 코드를 사용해서 C3P0를 사용할 수 있다.
13101303
</p>
13111304

13121305
<source><![CDATA[import org.apache.ibatis.datasource.unpooled.UnpooledDataSourceFactory;
@@ -1319,8 +1312,8 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
13191312
}
13201313
}]]></source>
13211314

1322-
<p>To set it up, add a property for each setter method you want MyBatis to call.
1323-
Below depicts a sample configuration which connects to a PostgreSQL database:</p>
1315+
<p>마이바티스가 호출할 setter메소드가 사용하는 프로퍼티를 추가해서 설정한다.
1316+
다음의 설정은 PostgreSQL 데이터베이스에 연결할때 사용한 샘플 설정이다. </p>
13241317

13251318
<source><![CDATA[<dataSource type="org.myproject.C3P0DataSourceFactory">
13261319
<property name="driver" value="org.postgresql.Driver"/>

0 commit comments

Comments
 (0)