Last active
November 14, 2024 03:47
-
-
Save Eng-Fouad/7b5925481dd391fcc74487a68484b987 to your computer and use it in GitHub Desktop.
Using JDBI in Quarkus (native mode) [JDBI 3.38.2]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quarkus.native.additional-build-args=-H:ReflectionConfigurationFiles=reflection-config.json,-H:DynamicProxyConfigurationFiles=proxy-config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "interfaces": [ "io.fouad.demo.db.UserDao" ] }, | |
{ "interfaces": [ "io.fouad.demo.db.FooDao" ] } | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{"name":"org.jdbi.v3.core.statement.SqlStatements","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.statement.StatementExceptions","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.argument.Arguments","methods":[{"name":"<init>","parameterTypes":["org.jdbi.v3.core.config.ConfigRegistry"]}]}, | |
{"name":"org.jdbi.v3.core.mapper.RowMappers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.mapper.ColumnMappers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.mapper.Mappers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.mapper.MapMappers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.mapper.MapEntryMappers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.mapper.reflect.ReflectionMappers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.mapper.reflect.internal.PojoTypes","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.collector.JdbiCollectors","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.qualifier.Qualifiers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.result.ResultProducers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.array.SqlArrayTypes","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.transaction.SerializableTransactionRunner$Configuration","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.extension.Extensions","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.internal.OnDemandExtensions","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.internal.EnumStrategies","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.config.internal.ConfigCaches","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.enums.Enums","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.core.Handles","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.Handlers","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.HandlerDecorators","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.SqlObjects","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.SqlObject","methods":[{"name":"getHandle"}]}, | |
{"name":"org.jdbi.v3.sqlobject.config.internal.RegisterRowMapperImpl","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.transaction.internal.TransactionDecorator","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.customizer.TimestampedConfig","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.customizer.internal.BindFactory","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.customizer.internal.BindListFactory","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.statement.internal.SqlObjectStatementConfiguration","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.statement.internal.SqlQueryHandler","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.sqlobject.statement.internal.SqlUpdateHandler","methods":[{"name":"<init>"}]}, | |
{"name":"org.jdbi.v3.postgres.PostgresTypes","methods":[{"name":"<init>"}]} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.fouad.demo.db; | |
public interface UserDao { | |
@SqlUpdate("CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR)") | |
void createTable(); | |
@SqlUpdate("INSERT INTO user(id, name) VALUES (?, ?)") | |
void insertPositional(int id, String name); | |
@SqlUpdate("INSERT INTO user(id, name) VALUES (:id, :name)") | |
void insertNamed(@Bind("id") int id, @Bind("name") String name); | |
@SqlUpdate("INSERT INTO user(id, name) VALUES (:id, :name)") | |
void insertBean(@BindBean User user); | |
@SqlQuery("SELECT * FROM user ORDER BY name") | |
@RegisterBeanMapper(User.class) | |
List<User> listUsers(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
great write up.