From 4952bc1cf8ece53978787fca4d4ae5a5225f57e2 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Sat, 30 Jan 2016 18:48:57 +0100 Subject: [PATCH] [#5016] Add DBMS_AQ.dequeueIterable() to create an Oracle AQ Iterable --- .../org/jooq/example/OracleAQExamples.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/jOOQ-examples/jOOQ-oracle-example/src/test/java/org/jooq/example/OracleAQExamples.java b/jOOQ-examples/jOOQ-oracle-example/src/test/java/org/jooq/example/OracleAQExamples.java index 174bb98eab..bbfb345e93 100644 --- a/jOOQ-examples/jOOQ-oracle-example/src/test/java/org/jooq/example/OracleAQExamples.java +++ b/jOOQ-examples/jOOQ-oracle-example/src/test/java/org/jooq/example/OracleAQExamples.java @@ -137,6 +137,26 @@ public class OracleAQExamples extends Utils { }); } + @Test + public void testAQIterable() throws Exception { + dsl.transaction(c -> { + + // Enqueue all authors + authors.stream().forEach(a -> { + DBMS_AQ.enqueue(dsl.configuration(), NEW_AUTHOR_AQ, a); + }); + + // Dequeue them again + int i = 0; + for (AuthorTRecord author : DBMS_AQ.dequeueIterable(dsl.configuration(), NEW_AUTHOR_AQ)) { + assertEquals(authors.get(i++), author); + + if (i == authors.size()) + break; + } + }); + } + @Test public void testAQWait() throws Exception { dsl.transaction(c -> {