How do you upgrade dropwizard jdbi 2.78 to jdbi version 3 since I want to make use of the joins functionality included in it.
Project member here.
We'll be publishing a more complete migration guide prior to v3 final release. In the meantime, one of our users just submitted a decent list of changes as a starting point:
(See https://github.com/jdbi/jdbi/issues/715)
Renamed classes (so not quite as simple as deleting imports and letting the IDE fix it):
The constructors for Jdbi have been replaced with a create() factory method.
ResultSetMapper is replaced with RowMapper and the map method no longer has the row index. A class named ResultSetMapper exists in Jdbi 3, but it serves a different purpose. @Mapper is replaced with @UseRowMapper. registerMapper() on Jdbi is replaced with registerRowMapper().
@BindIn is replaced with @BindList and no longer requires StringTemplate.
With the default Jdbi templating, angle brackets are not quoted, which means that IntelliJ understands the syntax after you configure the Parameter Pattern under Tools -> Database -> User Patterns.
Query no longer has a default type of Map and thus list() cannot be called on it directly. Call mapToMap() before calling list().
TransactionStatus no longer exists.
TransactionConsumer.useTransaction() only takes a Handle now, so the TransactionStatus argument needs to be removed when using this with the useTransaction() methods on Jdbi or Handle.
TransactionCallback.inTransaction() only takes a Handle now, so the TransactionStatus argument needs to be removed when using this with the inTransaction() methods on Jdbi or Handle.
CallbackFailedException no longer exists. The various functional interfaces such as HandleConsumer, HandleCallback, TransactionalConsumer, and TransactionalCallback, can now throw any exception type (but restricted using generics to avoid needless checked exception handling).
SQL Object support is no longer available by default. It must be registered every created Jdbi instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With