@@ -574,6 +574,24 @@ void staticMethodOnePrimitiveCharArgument() {
574574 }
575575 }
576576
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+
577595 @ Test
578596 void staticMethodMultipleArgument () {
579597 try (SqlSession sqlSession = sqlSessionFactory .openSession ()) {
@@ -683,6 +701,12 @@ public interface StaticMethodSqlProviderMapper {
683701 @ SelectProvider (type = SqlProvider .class , method = "onePrimitiveCharArgument" )
684702 char onePrimitiveCharArgument (char value );
685703
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+
686710 @ SelectProvider (type = SqlProvider .class , method = "multipleArgument" )
687711 int multipleArgument (@ Param ("value1" ) Integer value1 , @ Param ("value2" ) Integer value2 );
688712
@@ -744,6 +768,16 @@ public static StringBuilder onePrimitiveCharArgument(char value) {
744768 .append ("' FROM INFORMATION_SCHEMA.SYSTEM_USERS" );
745769 }
746770
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+
747781 public static CharSequence multipleArgument (@ Param ("value1" ) Integer value1 ,
748782 @ Param ("value2" ) Integer value2 ) {
749783 return "SELECT " + (value1 + value2 ) + " FROM INFORMATION_SCHEMA.SYSTEM_USERS" ;
0 commit comments