4343import  java .sql .Clob ;
4444import  java .util .List ;
4545import  java .util .Map ;
46+ import  java .util .Set ;
4647
4748import  static  org .hamcrest .MatcherAssert .assertThat ;
4849import  static  org .hamcrest .Matchers .equalTo ;
@@ -80,6 +81,7 @@ public Jackson() {
8081	private  final  Map <StringNode , StringNode > objectMap ;
8182	private  final  List <StringNode > list ;
8283	private  final  String  json ;
84+ 	Map <String , Map <String , List <Set <Long >>>> complexMap ;
8385
8486	protected  JsonMappingTests (boolean  supportsObjectMapKey ) {
8587		this .stringMap  = Map .of ( "name" , "ABC"  );
@@ -89,13 +91,14 @@ protected JsonMappingTests(boolean supportsObjectMapKey) {
8991		) : null ;
9092		this .list  = List .of ( new  StringNode ( "ABC"  ) );
9193		this .json  = "{\" name\" :\" abc\" }" ;
94+ 		this .complexMap  = Map .of ( "name" , Map .of ( "inner" , List .of ( Set .of ( 10L  ), Set .of ( 20L  ) ) ) );
9295	}
9396
9497	@ BeforeEach 
9598	public  void  setup (SessionFactoryScope  scope ) {
9699		scope .inTransaction (
97100				(session ) -> {
98- 					session .persist ( new  EntityWithJson ( 1 , stringMap , objectMap , list , json  ) );
101+ 					session .persist ( new  EntityWithJson ( 1 , stringMap , objectMap , list , json ,  complexMap  ) );
99102				}
100103		);
101104	}
@@ -152,7 +155,7 @@ public void verifyReadWorks(SessionFactoryScope scope) {
152155	public  void  verifyMergeWorks (SessionFactoryScope  scope ) {
153156		scope .inTransaction (
154157				(session ) -> {
155- 					session .merge ( new  EntityWithJson ( 2 , null , null , null , null   ) );
158+ 					session .merge ( new  EntityWithJson ( 2 , null , null , null , null ,  null ) );
156159				}
157160		);
158161
@@ -165,6 +168,7 @@ public void verifyMergeWorks(SessionFactoryScope scope) {
165168					assertThat ( entityWithJson .jsonString , is ( nullValue () ) );
166169					assertThat ( entityWithJson .jsonNode , is ( nullValue () ) );
167170					assertThat ( entityWithJson .jsonValue , is ( nullValue () ) );
171+ 					assertThat ( entityWithJson .complexMap , is ( nullValue () ) );
168172				}
169173		);
170174	}
@@ -267,6 +271,7 @@ public void verifyCriteriaUpdateQueryWorks(SessionFactoryScope scope) {
267271			assertThat ( entityWithJson .stringMap , is ( newMap  ) );
268272			assertThat ( entityWithJson .list , is ( newList  ) );
269273			assertThat ( entityWithJson .jsonString .replaceAll ( "\\ s" , ""  ), is ( newJson  ) );
274+ 			assertThat ( entityWithJson .complexMap , is ( complexMap  ) );
270275		} );
271276	}
272277
@@ -296,6 +301,9 @@ public static class EntityWithJson {
296301		@ JdbcTypeCode ( SqlTypes .JSON  )
297302		private  JsonValue  jsonValue ;
298303
304+ 		@ JdbcTypeCode ( SqlTypes .JSON  )
305+ 		private  Map <String , Map <String , List <Set <Long >>>> complexMap ;
306+ 
299307		public  EntityWithJson () {
300308		}
301309
@@ -304,12 +312,14 @@ public EntityWithJson(
304312				Map <String , String > stringMap ,
305313				Map <StringNode , StringNode > objectMap ,
306314				List <StringNode > list ,
307- 				String  jsonString ) {
315+ 				String  jsonString ,
316+ 				Map <String , Map <String , List <Set <Long >>>> complexMap ) {
308317			this .id  = id ;
309318			this .stringMap  = stringMap ;
310319			this .objectMap  = objectMap ;
311320			this .list  = list ;
312321			this .jsonString  = jsonString ;
322+ 			this .complexMap  = complexMap ;
313323		}
314324	}
315325
0 commit comments