@@ -574,6 +574,24 @@ void staticMethodOnePrimitiveCharArgument() {
574
574
}
575
575
}
576
576
577
+ @ Test
578
+ void boxing () {
579
+ try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
580
+ StaticMethodSqlProviderMapper mapper =
581
+ sqlSession .getMapper (StaticMethodSqlProviderMapper .class );
582
+ assertEquals (10 , mapper .boxing (10 ));
583
+ }
584
+ }
585
+
586
+ @ Test
587
+ void unboxing () {
588
+ try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
589
+ StaticMethodSqlProviderMapper mapper =
590
+ sqlSession .getMapper (StaticMethodSqlProviderMapper .class );
591
+ assertEquals (100 , mapper .unboxing (100 ));
592
+ }
593
+ }
594
+
577
595
@ Test
578
596
void staticMethodMultipleArgument () {
579
597
try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
@@ -683,6 +701,12 @@ public interface StaticMethodSqlProviderMapper {
683
701
@ SelectProvider (type = SqlProvider .class , method = "onePrimitiveCharArgument" )
684
702
char onePrimitiveCharArgument (char value );
685
703
704
+ @ SelectProvider (type = SqlProvider .class , method = "boxing" )
705
+ int boxing (int value );
706
+
707
+ @ SelectProvider (type = SqlProvider .class , method = "unboxing" )
708
+ int unboxing (Integer value );
709
+
686
710
@ SelectProvider (type = SqlProvider .class , method = "multipleArgument" )
687
711
int multipleArgument (@ Param ("value1" ) Integer value1 , @ Param ("value2" ) Integer value2 );
688
712
@@ -744,6 +768,16 @@ public static StringBuilder onePrimitiveCharArgument(char value) {
744
768
.append ("' FROM INFORMATION_SCHEMA.SYSTEM_USERS" );
745
769
}
746
770
771
+ public static StringBuilder boxing (Integer value ) {
772
+ return new StringBuilder ().append ("SELECT '" ).append (value )
773
+ .append ("' FROM INFORMATION_SCHEMA.SYSTEM_USERS" );
774
+ }
775
+
776
+ public static StringBuilder unboxing (int value ) {
777
+ return new StringBuilder ().append ("SELECT '" ).append (value )
778
+ .append ("' FROM INFORMATION_SCHEMA.SYSTEM_USERS" );
779
+ }
780
+
747
781
public static CharSequence multipleArgument (@ Param ("value1" ) Integer value1 ,
748
782
@ Param ("value2" ) Integer value2 ) {
749
783
return "SELECT " + (value1 + value2 ) + " FROM INFORMATION_SCHEMA.SYSTEM_USERS" ;
0 commit comments