Questions tagged [jdbi3]
49 questions
0
votes
0 answers
Jdbi string template engine conditional with expression
I'm trying to use jdbi string template engine with an expression in an if condition.
I tried different versions:
but I haven't found a way…

TheOni
- 810
- 9
- 26
0
votes
1 answer
Is there a way to use a custom strategy to map enum types in JDBI3?
I have a simple scenario where an enum is being sent for storage and I want to pull it out. However, I cannot use either Ordinal nor Name strategy. The value being stored is a value inside each enum instance.
TLDR: Is there a way for me to register…

hanzo2001
- 1,338
- 1
- 10
- 24
0
votes
1 answer
Jdbi3: transaction with more than one dao and @Transaction annotation
I have to execute a transactions that involves methods in more than one dao, so I am using something like:
jdbi.useHandle(handle -> {
handle.useTransaction(h -> {
Dao1 dao1 = h.attach(Dao1.class);
Dao2 dao2 =…

res1
- 3,482
- 5
- 29
- 50
-1
votes
1 answer
JDBI 3 in DropWizard, onDemand reusing connection
Trying to figure out this case from the documentation:
http://jdbi.org/#_attached_to_handle
Say you have
SomeClass dao1 = dbi.onDemand(SomeClass.class)
then you have something in another method, other place:
try ( Handle handle = dbi.open(); )…

mjs
- 21,431
- 31
- 118
- 200