@@ -462,15 +462,15 @@ private void applyResults(Result[] results, Class<?> resultType, List<ResultMapp
462
462
463
463
private String findColumnPrefix (Result result ) {
464
464
String columnPrefix = result .one ().columnPrefix ();
465
- if (columnPrefix .length () < 1 ) {
465
+ if (columnPrefix .isEmpty () ) {
466
466
columnPrefix = result .many ().columnPrefix ();
467
467
}
468
468
return columnPrefix ;
469
469
}
470
470
471
471
private String nestedResultMapId (Result result ) {
472
472
String resultMapId = result .one ().resultMap ();
473
- if (resultMapId .length () < 1 ) {
473
+ if (resultMapId .isEmpty () ) {
474
474
resultMapId = result .many ().resultMap ();
475
475
}
476
476
if (!resultMapId .contains ("." )) {
@@ -480,15 +480,15 @@ private String nestedResultMapId(Result result) {
480
480
}
481
481
482
482
private boolean hasNestedResultMap (Result result ) {
483
- if (result .one ().resultMap ().length () > 0 && result .many ().resultMap ().length () > 0 ) {
483
+ if (! result .one ().resultMap ().isEmpty () && ! result .many ().resultMap ().isEmpty () ) {
484
484
throw new BuilderException ("Cannot use both @One and @Many annotations in the same @Result" );
485
485
}
486
- return result .one ().resultMap ().length () > 0 || result .many ().resultMap ().length () > 0 ;
486
+ return ! result .one ().resultMap ().isEmpty () || ! result .many ().resultMap ().isEmpty () ;
487
487
}
488
488
489
489
private String nestedSelectId (Result result ) {
490
490
String nestedSelect = result .one ().select ();
491
- if (nestedSelect .length () < 1 ) {
491
+ if (nestedSelect .isEmpty () ) {
492
492
nestedSelect = result .many ().select ();
493
493
}
494
494
if (!nestedSelect .contains ("." )) {
@@ -499,19 +499,19 @@ private String nestedSelectId(Result result) {
499
499
500
500
private boolean isLazy (Result result ) {
501
501
boolean isLazy = configuration .isLazyLoadingEnabled ();
502
- if (result .one ().select ().length () > 0 && FetchType .DEFAULT != result .one ().fetchType ()) {
502
+ if (! result .one ().select ().isEmpty () && FetchType .DEFAULT != result .one ().fetchType ()) {
503
503
isLazy = result .one ().fetchType () == FetchType .LAZY ;
504
- } else if (result .many ().select ().length () > 0 && FetchType .DEFAULT != result .many ().fetchType ()) {
504
+ } else if (! result .many ().select ().isEmpty () && FetchType .DEFAULT != result .many ().fetchType ()) {
505
505
isLazy = result .many ().fetchType () == FetchType .LAZY ;
506
506
}
507
507
return isLazy ;
508
508
}
509
509
510
510
private boolean hasNestedSelect (Result result ) {
511
- if (result .one ().select ().length () > 0 && result .many ().select ().length () > 0 ) {
511
+ if (! result .one ().select ().isEmpty () && ! result .many ().select ().isEmpty () ) {
512
512
throw new BuilderException ("Cannot use both @One and @Many annotations in the same @Result" );
513
513
}
514
- return result .one ().select ().length () > 0 || result .many ().select ().length () > 0 ;
514
+ return ! result .one ().select ().isEmpty () || ! result .many ().select ().isEmpty () ;
515
515
}
516
516
517
517
private void applyConstructorArgs (Arg [] args , Class <?> resultType , List <ResultMapping > resultMappings ,
@@ -539,7 +539,7 @@ private void applyConstructorArgs(Arg[] args, Class<?> resultType, List<ResultMa
539
539
}
540
540
541
541
private String nullOrEmpty (String value ) {
542
- return value == null || value .trim ().length () == 0 ? null : value ;
542
+ return value == null || value .trim ().isEmpty () ? null : value ;
543
543
}
544
544
545
545
private KeyGenerator handleSelectKeyAnnotation (SelectKey selectKeyAnnotation , String baseStatementId ,
0 commit comments