Skip to content

Commit 3ba1041

Browse files
committed
[hibernate#2156] add documentation
1 parent 3f0193a commit 3ba1041

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

documentation/src/main/asciidoc/reference/introduction.adoc

+14
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,20 @@ sessionFactory.withTransaction( (session, tx) -> session.persist(book) )
10701070

10711071
This is probably the most convenient thing to use most of the time.
10721072

1073+
=== Calling the Vert.x SQL client directly
1074+
1075+
The `withConnection()` method makes it possible to call the Vert.x `SqlConnection` directly, for example:
1076+
1077+
[source,java]
1078+
----
1079+
session.withConnection((SqlConnection connection)
1080+
-> connection.query("select title from book").execute()
1081+
.toCompletionStage() )
1082+
.invoke( results -> results.forEach( row -> ... ) )
1083+
----
1084+
1085+
Most of the time, it's easier to just use a <<_queries,native query>>.
1086+
10731087
== Integrating with Vert.x
10741088

10751089
:vertx-context-introduction: https://vertx.io/blog/an-introduction-to-the-vert-x-context-object/

0 commit comments

Comments
 (0)