I has immutable class like: JDBI Developer Guide states that it should work with @Value annotations. At least with bindBean() or @BindBean. But when I use org.jdbi.v3.core.result.ResultBearing#mapToBean method with MyEntry.class it throws java.lang.NoSuchMethodException: no such constructor: my.company.MyEntry.<init>()void/newInvokeSpecial. Looks like it trying create object with empty constructor and set fields after it. But I want to let my class be immutable.
Tag: jdbi
argument mismatch; invalid functional descriptor for lambda expression
I am using the jdbi library like so: This try catch pattern is repeated a few times, with various different queries passed to the jdbi.withHandle method. Another example: The jdbi.withHandle method has this signature: I am trying to find a way to reduce the duplication around the try-catch, so that I can use something like this instead: i.e. the handleTransientExceptions
Are all exceptions throw from Jdbi of type JdbiException?
It states here: https://jdbi.org/apidocs/org/jdbi/v3/core/JdbiException.html that JdbiException is the Base unchecked exception for exceptions thrown from jdbi. However, if I’m calling the withHandle method with various different callbacks: the docs state that it throws X extends Exception (rather than throwing JdbiExecption as I would have expected) and describes it as @param <X> exception type thrown by the callback, if any.: I
Use BeanMapper from within a RowMapper?
I’m using JDBI’s SQL Objects declarative API to map an object containing a one-to-many relationship: Initially it looked like a RowReducer would be ideal: However I soon discovered that RowReducers don’t work with ResultIterators (I’m working with a large database so it’s important to be able to stream these) so now I’m reverting back to implementing a RowMapper instead. I’d
A way to bind Java Map to sql varchar in JDBI INSERT statement
Is there a way to bind a java Map<String, Object> to a varchar in the the JDBI @BindBean annotation. So for example I have a class Something.class and I create a @SqlBatch(“INSERT INTO Something (name, payload) VALUES(:name, :payload)”). Now in my java class the name is of type String and payload is of type Map<String, Object> and I want in
Use a list of strings in IN clause with JDBI
I’m using JDBI / Dropwizard for a project and would like to run some simple queries. I have a query like so: private static final String GET_STUFF = “SELECT * FROM myTable WHERE state IN (:desiredState)” I bind the variable in my method like so: However, I get the following error when running: I’m passing in states as an ArrayList
JDBI’s @BindBean doesn’t find named parameters in bean class during INSERT
I am consistently getting the following exception below when inserting values using JDBI’s @BindBean into my Mysql database within Dropwizard. The problem seems to be that JDBI is unable to find the properties in the bean. I already isolated the issue into a separate project, but can’t figure out where this is going wrong. I would be very grateful for
What is the difference between JDBC and JDBI?
I want to know about the differences between JDBC and JDBI in java. In particular, which one is generally better and why? Answer (I am the primary author of jDBI) jDBI is a convenience library built on top of JDBC. JDBC works very well but generally seems to optimize for the database vendors (driver writers) over the users. jDBI attempts