Skip to content

Commit

Permalink
[#11] Demo code should link to relevant sections of the manual - Demo…
Browse files Browse the repository at this point in the history
…13Reactive
  • Loading branch information
lukaseder committed Jan 11, 2024
1 parent 78e134d commit c66e842
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public class Demo13Reactive extends AbstractDemo {

@Test
public void reactiveQuerying() {
// If you configure jOOQ with an R2DBC connection as in this demo, then you can use jOOQ's reactive APIs via
// its various Publisher implementations. For example, a ResultQuery<R> is a Publisher<R>, and can be used with
// any RS compliant streaming library, such as Reactor, below:

record Actor(String firstName, String lastName) {}

Flux.from(ctx
Expand All @@ -26,6 +30,9 @@ record Actor(String firstName, String lastName) {}
.collectList()
.block()
.forEach(System.out::println);

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/
}

@Test
Expand Down Expand Up @@ -64,6 +71,9 @@ public void reactiveTransactions() {
.collectList()
.block()
.forEach(System.out::println);

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class Demo13Reactive : AbstractDemo() {

@Test
fun reactiveQuerying() {
// If you configure jOOQ with an R2DBC connection as in this demo, then you can use jOOQ's reactive APIs via
// its various Publisher implementations. For example, a ResultQuery<R> is a Publisher<R>, and can be used with
// any RS compliant streaming library, such as Reactor, below:

data class Actor(val firstName: String?, val lastName: String?)

Flux.from(ctx
Expand All @@ -28,6 +32,9 @@ class Demo13Reactive : AbstractDemo() {
.map(mapping(::Actor))
.toIterable()
.forEach { println(it) }

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/
}

@Test
Expand Down Expand Up @@ -69,6 +76,9 @@ class Demo13Reactive : AbstractDemo() {
.where(ACTOR.ACTOR_ID.eq(201L)))
.toIterable()
.forEach { println(it) }

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class Demo13Reactive extends AbstractDemo {

@Test
def reactiveQuerying(): Unit = {
// If you configure jOOQ with an R2DBC connection as in this demo, then you can use jOOQ's reactive APIs via
// its various Publisher implementations. For example, a ResultQuery<R> is a Publisher<R>, and can be used with
// any RS compliant streaming library, such as Reactor, below:

case class Actor(firstName: String, lastName: String)

Flux
Expand All @@ -23,6 +27,9 @@ class Demo13Reactive extends AbstractDemo {
.collectList
.block
.forEach(println(_))

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/
}

@Test
Expand Down Expand Up @@ -64,6 +71,9 @@ class Demo13Reactive extends AbstractDemo {
.collectList
.block
.forEach(println(_))

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public class Demo13Reactive extends AbstractDemo {

@Test
public void reactiveQuerying() {
// If you configure jOOQ with an R2DBC connection as in this demo, then you can use jOOQ's reactive APIs via
// its various Publisher implementations. For example, a ResultQuery<R> is a Publisher<R>, and can be used with
// any RS compliant streaming library, such as Reactor, below:

record Actor(String firstName, String lastName) {}

Flux.from(ctx
Expand All @@ -26,6 +30,9 @@ record Actor(String firstName, String lastName) {}
.collectList()
.block()
.forEach(System.out::println);

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/
}

@Test
Expand Down Expand Up @@ -64,6 +71,9 @@ public void reactiveTransactions() {
.collectList()
.block()
.forEach(System.out::println);

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class Demo13Reactive : AbstractDemo() {

@Test
fun reactiveQuerying() {
// If you configure jOOQ with an R2DBC connection as in this demo, then you can use jOOQ's reactive APIs via
// its various Publisher implementations. For example, a ResultQuery<R> is a Publisher<R>, and can be used with
// any RS compliant streaming library, such as Reactor, below:

data class Actor(val firstName: String?, val lastName: String?)

Flux.from(ctx
Expand All @@ -28,6 +32,9 @@ class Demo13Reactive : AbstractDemo() {
.map(mapping(::Actor))
.toIterable()
.forEach { println(it) }

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/
}

@Test
Expand Down Expand Up @@ -69,6 +76,9 @@ class Demo13Reactive : AbstractDemo() {
.where(ACTOR.ACTOR_ID.eq(201L)))
.toIterable()
.forEach { println(it) }

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class Demo13Reactive extends AbstractDemo {

@Test
def reactiveQuerying(): Unit = {
// If you configure jOOQ with an R2DBC connection as in this demo, then you can use jOOQ's reactive APIs via
// its various Publisher implementations. For example, a ResultQuery<R> is a Publisher<R>, and can be used with
// any RS compliant streaming library, such as Reactor, below:

case class Actor(firstName: String, lastName: String)

Flux
Expand All @@ -23,6 +27,9 @@ class Demo13Reactive extends AbstractDemo {
.collectList
.block
.forEach(println(_))

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/fetching/reactive-fetching/
}

@Test
Expand Down Expand Up @@ -64,6 +71,9 @@ class Demo13Reactive extends AbstractDemo {
.collectList
.block
.forEach(println(_))

// More information here:
// https://www.jooq.org/doc/latest/manual/sql-execution/transaction-management/
}

@After
Expand Down

0 comments on commit c66e842

Please sign in to comment.