@@ -115,14 +115,14 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
115
115
lazyLoadingEnabled
116
116
</td >
117
117
<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 > 속성을 사용해서 대체할 수 있다.
120
120
</td >
121
121
<td >
122
122
true | false
123
123
</td >
124
124
<td >
125
- true
125
+ false
126
126
</td >
127
127
</tr >
128
128
<tr >
@@ -242,9 +242,9 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
242
242
localCacheScope
243
243
</td >
244
244
<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에서 두개의 다른 호출사이에는 데이터를 공유하지 않는다.
248
248
</td >
249
249
<td >
250
250
SESSION | STATEMENT
@@ -258,11 +258,11 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
258
258
jdbcTypeForNull
259
259
</td >
260
260
<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 처럼 일반적인 값을 사용해서 동작한다.
263
263
</td >
264
264
<td >
265
- JdbcType enumeration. Most common are: NULL, VARCHAR and OTHER
265
+ JdbcType 이늄. 대부분은 NULL, VARCHAR 나 OTHER 를 공통적으로 사용한다.
266
266
</td >
267
267
<td >
268
268
OTHER
@@ -273,10 +273,10 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
273
273
lazyLoadTriggerMethods
274
274
</td >
275
275
<td >
276
- Specifies which Object's methods trigger a lazy load
276
+ 늦은 로딩을 야기하는 객체의 메소드를 명시
277
277
</td >
278
278
<td >
279
- A method name list separated by commas
279
+ 메소드 이름을 나열하고 여러개일 경우 콤마(,) 로 구분
280
280
</td >
281
281
<td >
282
282
equals,clone,hashCode,toString
@@ -287,10 +287,10 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
287
287
defaultScriptingLanguage
288
288
</td >
289
289
<td >
290
- Specifies the language used by default for dynamic SQL generation.
290
+ 동적으로 SQL을 만들기 위해 기본적으로 사용하는 언어를 명시
291
291
</td >
292
292
<td >
293
- A type alias or fully qualified class name.
293
+ 타입별칭이나 패키지 경로를 포함한 클래스명
294
294
</td >
295
295
<td >
296
296
org.apache.ibatis.scripting.xmltags.XMLDynamicLanguageDriver
@@ -301,7 +301,9 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
301
301
callSettersOnNulls
302
302
</td >
303
303
<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을 셋팅할 수 없다는 점은 알아두면 좋다.
305
307
</td >
306
308
<td >
307
309
true | false
@@ -315,35 +317,36 @@ SqlSessionFactory factory = sqlSessionFactoryBuilder.build(reader, environment,
315
317
logPrefix
316
318
</td >
317
319
<td >
318
- Specifies the prefix string that MyBatis will add to the logger names.
320
+ 마이바티스가 로거(logger) 이름에 추가할 접두사 문자열을 명시
319
321
</td >
320
322
<td >
321
- Any String
323
+ 문자열
322
324
</td >
323
325
<td >
324
- Not set
326
+ 셋팅하지 않음
325
327
</td >
326
328
</tr >
327
329
<tr >
328
330
<td >
329
331
logImpl
330
332
</td >
331
333
<td >
332
- Specifies which logging implementation MyBatis should use. If this setting is not present logging implementation will be autodiscovered.
334
+ 마이바티스가 사용할 로깅 구현체를 명시
335
+ 이 설정을 사용하지 않으면 마이바티스가 사용할 로깅 구현체를 자동으로 찾는다.
333
336
</td >
334
337
<td >
335
338
SLF4J | LOG4J | LOG4J2 | JDK_LOGGING | COMMONS_LOGGING | STDOUT_LOGGING | NO_LOGGING
336
339
</td >
337
340
<td >
338
- Not set
341
+ 셋팅하지 않음
339
342
</td >
340
343
</tr >
341
344
<tr >
342
345
<td >
343
346
proxyFactory
344
347
</td >
345
348
<td >
346
- Specifies the proxy tool that MyBatis will use for creating lazy loading capable objects.
349
+ 마이바티스가 늦은 로딩을 처리할 객체를 생성할 때 사용할 프록시 툴을 명시
347
350
</td >
348
351
<td >
349
352
CGLIB | JAVASSIST
@@ -945,9 +948,8 @@ public class ExampleTypeHandler extends BaseTypeHandler<String> {
945
948
946
949
<p >JDBC타입에 대한 자동검색 기능은 애노테이션을 명시한 경우에만 가능하다는 것을 알아둘 필요가 있다. </p >
947
950
<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를 만들때 실제 클래스를 전달할 것이다.
951
953
</p >
952
954
953
955
<source ><![CDATA[ //GenericTypeHandler.java
@@ -962,51 +964,43 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
962
964
...
963
965
]]> </source >
964
966
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
+ 이어서 각각을 다룬다.
967
969
</p >
968
970
969
971
</subsection >
970
972
971
973
<subsection name =" Handling Enums" >
972
974
<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 > 를 사용할 필요가 있을것이다.
975
976
</p >
976
977
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 > 를 사용한다.
981
980
</p >
982
981
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 >
985
984
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 >는 순서값을 사용해서 숫자를 매핑할 것이다.
990
988
</p >
991
989
<source ><![CDATA[ <!-- mybatis-config.xml -->
992
990
<typeHandlers>
993
991
<typeHandler handler="org.apache.ibatis.type.EnumOrdinalTypeHandler" javaType="java.math.RoundingMode"/>
994
992
</typeHandlers>
995
993
]]> </source >
996
994
<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 >을 사용해서 어떤곳에는 문자열로 매핑하고 다른곳에는 숫자로 매핑해야 한다면 무엇을 해야 하나?
999
996
</p >
1000
997
<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구문에 사용할 타입핸들러를 몀시적으로 설정한다.
1005
1000
</p >
1006
1001
<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
+ 그래서 문서를 보면서 처음 봤다면 일단 이부분은 건너띄고 다음에 다시 볼수도 있다. )
1010
1004
</p >
1011
1005
<source ><![CDATA[ <!DOCTYPE mapper
1012
1006
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
@@ -1051,8 +1045,7 @@ public class GenericTypeHandler<E extends MyObject> extends BaseTypeHandler<E> {
1051
1045
</mapper>
1052
1046
]]> </source >
1053
1047
<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 >을 사용해야 한다는 점을 알아두자.
1056
1049
</p >
1057
1050
</subsection >
1058
1051
@@ -1296,7 +1289,7 @@ data_source 프로퍼티가 InitialContext 에서 직접 찾을 것이다.</li>
1296
1289
<p >이 설정은 인스턴스화할 때 InitialContext 생성자에 “encoding” 프로퍼티를 “UTF8” 로 전달한다.</p >
1297
1290
1298
1291
<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구현체를 만들수 있다.
1300
1293
</p >
1301
1294
1302
1295
<source ><![CDATA[ public interface DataSourceFactory {
@@ -1305,8 +1298,8 @@ data_source 프로퍼티가 InitialContext 에서 직접 찾을 것이다.</li>
1305
1298
}]]> </source >
1306
1299
1307
1300
<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를 사용할 수 있다.
1310
1303
</p >
1311
1304
1312
1305
<source ><![CDATA[ import org.apache.ibatis.datasource.unpooled.UnpooledDataSourceFactory;
@@ -1319,8 +1312,8 @@ public class C3P0DataSourceFactory extends UnpooledDataSourceFactory {
1319
1312
}
1320
1313
}]]> </source >
1321
1314
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 >
1324
1317
1325
1318
<source ><![CDATA[ <dataSource type="org.myproject.C3P0DataSourceFactory">
1326
1319
<property name="driver" value="org.postgresql.Driver"/>
0 commit comments