@@ -436,16 +436,15 @@ public void testJsonMapping() {
436
436
tryAwaitNone (connection .close ());
437
437
}
438
438
}
439
-
440
439
/**
441
440
* <p>
442
441
* Verifies the implementation of Java to SQL and SQL to Java type mappings
443
442
* where the Java type is {@link Boolean} and the SQL type is a numeric type.
444
- * The R2DBC 0.9 .0 Specification only requires that Java {@code Boolean} be
445
- * mapped to the SQL BOOLEAN type, however Oracle Database does not support a
446
- * BOOLEAN column type. To allow the use of the {@code Boolean} bind
447
- * values, Oracle JDBC supports binding the Boolean as a NUMBER. Oracle
448
- * R2DBC is expected to expose this functionality as well.
443
+ * The R2DBC 1.0 .0 Specification only requires that Java {@code Boolean} be
444
+ * mapped to the SQL BOOLEAN type, however Oracle Database did not support a
445
+ * BOOLEAN column type until the 23ai release . To allow the use of the
446
+ * {@code Boolean} bind values, Oracle JDBC supports binding the Boolean as a
447
+ * NUMBER. Oracle R2DBC is expected to expose this functionality as well.
449
448
*</p>
450
449
*/
451
450
@ Test
@@ -474,6 +473,41 @@ public void testBooleanNumericMapping() {
474
473
}
475
474
}
476
475
476
+ /**
477
+ * <p>
478
+ * Verifies the implementation of Java to SQL and SQL to Java type mappings
479
+ * where the Java type is {@link Boolean} and the SQL type is BOOLEAN. Oracle
480
+ * Database added support for a BOOLEAN column type in the 23ai release.
481
+ *</p>
482
+ */
483
+ @ Test
484
+ public void testBooleanMapping () {
485
+ assumeTrue (databaseVersion () >= 23 ,
486
+ "BOOLEAN requires Oracle Database 23ai or newer" );
487
+
488
+ Connection connection =
489
+ Mono .from (sharedConnection ()).block (connectTimeout ());
490
+ try {
491
+ // Expect BOOLEAN and Boolean to map
492
+ verifyTypeMapping (connection , true , "BOOLEAN" ,
493
+ (expected , actual ) -> assertEquals (Boolean .TRUE , actual ));
494
+ verifyTypeMapping (connection , false , "BOOLEAN" ,
495
+ (expected , actual ) -> assertEquals (Boolean .FALSE , actual ));
496
+
497
+ // Expect NUMBER and Boolean to map, with Row.get(..., Boolean.class)
498
+ // mapping the NUMBER column value to Boolean
499
+ verifyTypeMapping (connection , true , "BOOLEAN" ,
500
+ row -> row .get (0 , Boolean .class ),
501
+ (expected , actual ) -> assertTrue (actual ));
502
+ verifyTypeMapping (connection , false , "BOOLEAN" ,
503
+ row -> row .get (0 , Boolean .class ),
504
+ (expected , actual ) -> assertFalse (actual ));
505
+ }
506
+ finally {
507
+ tryAwaitNone (connection .close ());
508
+ }
509
+ }
510
+
477
511
/**
478
512
* <p>
479
513
* Verifies the implementation of Java to SQL and SQL to Java type mappings
0 commit comments