jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
385 stars 53 forks source link

Would it be possible to instantiate a DAO provided a transaction query execution #155

Closed ghost closed 4 years ago

ghost commented 4 years ago

In order to operate across multiple tables via DAOs in a single transaction.

jklingsporn commented 4 years ago

I am afraid that is not possible, but you can easily write your own queries using the underlying QueryExecutor. If you're using one of the reactive-modules use one of the QueryExecutor's transaction-methods. If you're using a jdbc-module you can use the DSLContext-transaction-method's inside the QueryExecutor's executeAny-method.

Hope that helps!

Am Fr., 29. Mai 2020 um 03:44 Uhr schrieb William Welling < notifications@github.com>:

In order to operate across multiple tables via DAOs in a single transaction.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jklingsporn/vertx-jooq/issues/155, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQLZXWUIEGRLTBWOENSVDLRT4HP7ANCNFSM4NNUDGSQ .

-- Jens Klingsporn Beselerstraße 33 22607 Hamburg Tel: 0151/70102082

ghost commented 4 years ago

Thanks for the quick reply. The reason to use the DAOs is for the automatic mapping to the POJOs. Is there a convenient way to go from QueryResult and/or Row directly to the POJO or must it go to the Record and then to the POJO via interface? Using toJson/fromJson is not an option at this time due to heavy use of UUID and LocalDateTime types.

jklingsporn commented 4 years ago

Check the generated RowMapper-class (I assume you're using a reactive-module).

Am Fr., 29. Mai 2020 um 14:23 Uhr schrieb William Welling < notifications@github.com>:

Thanks for the quick reply. The reason to use the DAOs is for the automatic mapping to the POJOs. Is there a convenient way to go from QueryResult and/or Row directly to the POJO or must it go to the Record and then to the POJO via interface? Using toJson/fromJson is not an option at this time due to heavy use of UUID and LocalDateTime types.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jklingsporn/vertx-jooq/issues/155#issuecomment-635943475, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQLZXQ6A6ZEEOOIB3WW3Q3RT6SMVANCNFSM4NNUDGSQ .

-- Jens Klingsporn Beselerstraße 33 22607 Hamburg Tel: 0151/70102082

ghost commented 4 years ago

Great. Thanks. Closing this issue.

ghost commented 4 years ago

@jklingsporn is it possible to go from Row to Record?