30
30
import tk .mybatis .mapper .util .SimpleTypeUtil ;
31
31
import tk .mybatis .mapper .util .StringUtil ;
32
32
33
+ import java .util .ArrayList ;
34
+ import java .util .List ;
33
35
import java .util .Properties ;
34
36
35
37
/**
38
40
* @author liuzh
39
41
*/
40
42
public class Config {
43
+ public static final String PREFIX = "mapper" ;
44
+
45
+ private List <Class > mappers = new ArrayList <Class >();
41
46
private String UUID ;
42
47
private String IDENTITY ;
43
48
private boolean BEFORE ;
@@ -52,15 +57,15 @@ public class Config {
52
57
/**
53
58
* @since 3.5.0
54
59
*/
55
- private boolean enumAsSimpleType = false ;
60
+ private boolean enumAsSimpleType ;
56
61
/**
57
62
* 是否支持方法上的注解,默认false
58
63
*/
59
64
private boolean enableMethodAnnotation ;
60
65
/**
61
66
* 对于一般的getAllIfColumnNode,是否判断!='',默认不判断
62
67
*/
63
- private boolean notEmpty = false ;
68
+ private boolean notEmpty ;
64
69
/**
65
70
* 字段转换风格,默认驼峰转下划线
66
71
*/
@@ -262,6 +267,38 @@ public void setOrder(String order) {
262
267
this .BEFORE = "BEFORE" .equalsIgnoreCase (order );
263
268
}
264
269
270
+ public String getIdentity () {
271
+ return getIDENTITY ();
272
+ }
273
+
274
+ public void setIdentity (String identity ) {
275
+ setIDENTITY (identity );
276
+ }
277
+
278
+ public List <Class > getMappers () {
279
+ return mappers ;
280
+ }
281
+
282
+ public void setMappers (List <Class > mappers ) {
283
+ this .mappers = mappers ;
284
+ }
285
+
286
+ public String getUuid () {
287
+ return getUUID ();
288
+ }
289
+
290
+ public void setUuid (String uuid ) {
291
+ setUUID (uuid );
292
+ }
293
+
294
+ public boolean isBefore () {
295
+ return isBEFORE ();
296
+ }
297
+
298
+ public void setBefore (boolean before ) {
299
+ setBEFORE (before );
300
+ }
301
+
265
302
/**
266
303
* 配置属性
267
304
*
@@ -297,26 +334,15 @@ public void setProperties(Properties properties) {
297
334
if (StringUtil .isNotEmpty (ORDER )) {
298
335
setOrder (ORDER );
299
336
}
300
- String notEmpty = properties .getProperty ("notEmpty" );
301
- if (StringUtil .isNotEmpty (notEmpty )) {
302
- this .notEmpty = notEmpty .equalsIgnoreCase ("TRUE" );
303
- }
304
- String enableMethodAnnotation = properties .getProperty ("enableMethodAnnotation" );
305
- if (StringUtil .isNotEmpty (enableMethodAnnotation )) {
306
- this .enableMethodAnnotation = enableMethodAnnotation .equalsIgnoreCase ("TRUE" );
307
- }
308
- String checkExampleStr = properties .getProperty ("checkExampleEntityClass" );
309
- if (StringUtil .isNotEmpty (checkExampleStr )) {
310
- this .checkExampleEntityClass = checkExampleStr .equalsIgnoreCase ("TRUE" );
311
- }
337
+ this .notEmpty = Boolean .valueOf (properties .getProperty ("notEmpty" ));
338
+ this .enableMethodAnnotation = Boolean .valueOf (properties .getProperty ("enableMethodAnnotation" ));
339
+ this .checkExampleEntityClass = Boolean .valueOf (properties .getProperty ("checkExampleEntityClass" ));
340
+ //默认值 true,所以要特殊判断
312
341
String useSimpleTypeStr = properties .getProperty ("useSimpleType" );
313
342
if (StringUtil .isNotEmpty (useSimpleTypeStr )) {
314
- this .useSimpleType = useSimpleTypeStr .equalsIgnoreCase ("TRUE" );
315
- }
316
- String enumAsSimpleTypeStr = properties .getProperty ("enumAsSimpleType" );
317
- if (StringUtil .isNotEmpty (enumAsSimpleTypeStr )) {
318
- this .enumAsSimpleType = enumAsSimpleTypeStr .equalsIgnoreCase ("TRUE" );
343
+ this .useSimpleType = Boolean .valueOf (useSimpleTypeStr );
319
344
}
345
+ this .enumAsSimpleType = Boolean .valueOf (properties .getProperty ("enumAsSimpleType" ));
320
346
//注册新的基本类型,以逗号隔开,使用全限定类名
321
347
String simpleTypes = properties .getProperty ("simpleTypes" );
322
348
if (StringUtil .isNotEmpty (simpleTypes )) {
0 commit comments