Bind arrays in Sql Objects queries #2454
-
Hi, I am using jdbi with Postgres database and Postgres plugin installed. Have I to use Enum are supported ?
is valid/correct? From my tests it seems to work but I don't find in the documentation that enum are supported by array types. Another doubt, can I use for example
or I have to use Thanks for the help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
With the Postgres plugin installed, any scalar type that the server supports arrays of should be supported. Enums ( When writing DAO code, I would encourage you to write test cases that cover your usage of Jdbi. For example, a unit test for your DAO interface would check that enums can be read and written, and that |
Beta Was this translation helpful? Give feedback.
@Bind
is used to change the name of the parameter binding. If the method parameter names are present (non-default compiler configuration), then@Bind
is optional. See: https://jdbi.org/#compiling_with_parameter_namesWith the Postgres plugin installed, any scalar type that the server supports arrays of should be supported. Enums (
Test[]
), primitives (long[]
), and boxed (Long[]
) should all work.When writing DAO code, I would encourage you to write test cases that cover your usage of Jdbi. For example, a unit test for your DAO interface would check that enums can be read and written, and that
Long
s are stored. That checks that you are invoking Jdbi in a way that you get the results you exp…