@@ -32,6 +32,7 @@ private static class ArrayEntity {
3232 public List <Short > shortArray ;
3333 public List <Integer > integerArray ;
3434 public List <Boolean > booleanArray ;
35+ public List <String > jsonbArray ;
3536
3637 public List <String > getStringArray () {
3738 return stringArray ;
@@ -43,6 +44,7 @@ public List<String> getStringArray() {
4344 public List <Short > getShortArray () { return shortArray ; }
4445 public List <Integer > getIntegerArray () { return integerArray ; }
4546 public List <Boolean > getBooleanArray () { return booleanArray ; }
47+ public List <String > getJsonbArray () { return jsonbArray ; }
4648 }
4749
4850
@@ -70,6 +72,7 @@ public ArrayEntityMapping() {
7072 mapShortArray ("col_short_array" , ArrayEntity ::getShortArray );
7173 mapIntegerArray ("col_integer_array" , ArrayEntity ::getIntegerArray );
7274 mapBooleanArray ("col_boolean_array" , ArrayEntity ::getBooleanArray );
75+ mapJsonbArray ("col_jsonb_array" , ArrayEntity ::getJsonbArray );
7376 }
7477 }
7578
@@ -93,6 +96,8 @@ public void saveAll_VarCharArray_Test() throws SQLException, UnknownHostExceptio
9396 testStringArray ("col_varchar_array" );
9497 }
9598
99+
100+
96101 @ Test
97102 public void saveAll_TextArray_Test () throws SQLException , UnknownHostException {
98103
@@ -187,6 +192,19 @@ public void saveAll_BooleanArray_Test() throws SQLException {
187192 testArrayInternal ("col_boolean_array" , entity , entity .booleanArray );
188193 }
189194
195+ @ Test
196+ public void saveAll_JsonbArray_Test () throws SQLException {
197+
198+ // Create the Entity to insert:
199+ ArrayEntity entity = new ArrayEntity ();
200+ entity .jsonbArray = Arrays .asList (
201+ "{\" bar\" : \" baz\" , \" balance\" : 7.77}" ,
202+ "{\" bar\" : \" baz\" , \" balance\" : 8.88}"
203+ );
204+
205+ testArrayInternal ("col_jsonb_array" , entity , entity .jsonbArray );
206+ }
207+
190208 @ SuppressWarnings ("unchecked" )
191209 private <T > void testArrayInternal (String columnLabel , ArrayEntity entity , List <T > samples ) throws SQLException {
192210 Objects .requireNonNull (samples , "samples" );
@@ -229,7 +247,8 @@ private boolean createTable() throws SQLException {
229247 " col_long_array int8[],\n " +
230248 " col_short_array int2[],\n " +
231249 " col_integer_array int4[],\n " +
232- " col_boolean_array boolean[]\n " +
250+ " col_boolean_array boolean[],\n " +
251+ " col_jsonb_array jsonb[]\n " +
233252 " );" ;
234253
235254 Statement statement = connection .createStatement ();
0 commit comments