Skip to content
Advertisement

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 some advice.

JavaScript

This is my value object

JavaScript

And I have created the following DAO to make use of the @BindBean functionality as described in http://jdbi.org/sql_object_api_argument_binding/ – both methods for inserting fail.

JavaScript

And this is my table definition.

JavaScript

And I am using the following JUnit integration test to recreate the error:

JavaScript

I am using Java 1.8.0_05, Dropwizard 0.9.2 and MySQL 5.7.9.

Advertisement

Answer

BindBean claims to work with JavaBeans. JavaBeans require getter and setters.

Please add getters and setters to your Car class.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement