Questions tagged [jdbi3]

49 questions
1
vote
1 answer

Jdbi throws error when using reduceRows to join, one-to-many relationship

I'm trying to write an object query with JDBI to deal with one-to-many relationship. As seen in the docs, reduceRows is the way to do that. But I got these errors blaming the constructor; Update: keep one constructor for each entity. I tested a…
Ali Ben Messaoud
  • 11,690
  • 8
  • 54
  • 87
0
votes
0 answers

JBI RowMapper impl with 0 rows

We have implemented JDBI RowMapper and wanted to check what will be the behavior if lets say the query returns 0 rows. The documentation says: Row mappers are invoked once for each row in the result set So what will happen if there were 0 rows…
sachin jain
  • 224
  • 1
  • 4
  • 16
0
votes
1 answer

JDBI bindMethodsList()/bindBeanList() throws UnableToCreateStatementException

I am trying to bind a list of tuples in JDBI: @Data @AllArgsConstructor @NoArgsConstructor @Builder @EqualsAndHashCode(onlyExplicitlyIncluded = true) public class AuthorBooks { @EqualsAndHashCode.Include public long authorId; …
EzyHoo
  • 301
  • 2
  • 14
0
votes
0 answers

JDBI useHandle waiting for completing transaction from another handler

I have an import method. First, a session record is created in the database. Then comes the import process, wrapped in a transaction. private void importTables(File sessionRootDirectory, UUID sessionId, ImportResult result) { …
0
votes
0 answers

Protocol errors with Amazon Redshift database. "ERROR: Invalid protocol sequence 'P' while in PortalSuspended state."

I Am trying to run select * from table_name limit 500000, but it returns this error in java Protocol errors with Amazon Redshift database. "ERROR: Invalid protocol sequence 'P' while in PortalSuspended state." Redshift driver:…
0
votes
0 answers

An illegal reflective access operation has occurred., While migrate the Spring boot application from java 11 to 17

An illegal reflective access operation has occurred., While migrate the Spring boot application from java 11 to 17. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by…
0
votes
1 answer

How to use Jdbi to create multi argument IN clause

I have a batch of values in a map and need to update a boolean column in my database with for rows matching both values in the map e.g. Map.of("a", 1, "b", 2) the update I want to run is update table set zoo = true where (foo, bar) in…
0
votes
1 answer

JDBI3: Mapping bean class didn't find any matching columns in result set when mapping to JoinRow

I have SQL schema and Java class for issue and ticket model defined as follow: @Data @NoArgsConstructor @AllArgsConstructor @Builder public class Ticket { private long id; private int ticket_int_1; private int ticket_int_2; private…
EzyHoo
  • 301
  • 2
  • 14
0
votes
1 answer

How to map foreign key attribute to record in Java with JDBI

Say my DB looks like this, presenting using POJO: class A { long id; // auto-increment primary key String aAttribute; } class B { long id; // auto-increment primary key long aId; // foreign key of class A String bAttribute; …
EzyHoo
  • 301
  • 2
  • 14
0
votes
1 answer

JDBI3 SqlObject Consumer: How to fix "No Mapper Registered" error?

What do I need to do to fix "No Mapper Registered" when trying to Stream a result set from a SqlObject DAO? The method is annotated with @RegisterBeanMapper and the documentation seems incomplete. According to…
0
votes
0 answers

JDBI how to bind table valued parameter for stored procedure

I have a stored Procedure which takes table valued parameter as input. I am using JDBI in my SpringBoot Application. How do I bind TVP to stored procedure. This is my Stored Procedure. CREATE PROCEDURE exampleSP @country char(2), …
0
votes
1 answer

JDBI can not auto map for my class when i use mapToBean

I have Category and PaCategory public class Category implements Serializable { private int categoryId; private int paCategoryId; private String name; private PaCategory paCategory; public Category() { } //getter…
0
votes
1 answer

UnableToCreateStatementException JDBI3 using in caluse rowMapper

I have this query that when is executed I have an expection @SqlQuery("SELECT * FROM TABLEA WHERE m= :mAND values in ()") @RegisterRowMapper(TableARsMapper.class) Optional getByValues(@BindList("values") List values,…
mdc
  • 3
  • 1
0
votes
0 answers

Unable to run basic declarative jdbi3 in kotlin in existing java gradle project

I am new to kotlin, my basic build.gralde is as follows in an existing java + gradle project. plugins { id "org.jetbrains.kotlin.jvm" version "1.7.20" } dependencies { implementation("org.postgresql:postgresql") …
user1064504
  • 573
  • 6
  • 16
0
votes
1 answer

JDBI useTransaction does not commit preparedBatch

I am using JDBI to insert a few rows in MariaDB 10.6.8 using Hikari connection pool with autoCommit set to false. My expectation was that useTransaction(..) will open a transaction and commit it after a successful batch insert. However, this is not…
alecswan
  • 3,670
  • 5
  • 25
  • 35