Replies: 2 comments 2 replies
-
Hi @gpsfl , I don't know of anyone who has done this before. The What error do you get when it doesn't work now? |
Beta Was this translation helpful? Give feedback.
-
The SET type is an enumeration of which 0-n can be selected. MySQL represents it as a comma separated string and I think that's also the way you read/write it using JDBC. I managed to read them as a string in JDBI, but this means you have to split/join it every time you want to access the values. When defining it as a Set or a Set (where MyEnum is an enum containing all possible options), JDBI will attempt to bind it as an array instead of transforming it to the appropriate string representation. MySQL doesn't support arrays, which is why it throws an exception. Is it possible to tell JDBI about the SQL type of the field, so it can bind/map it differently? |
Beta Was this translation helpful? Give feedback.
-
How do you use JDBI with the MySQL SET data type? I've tried mapping it into a Java Set and List, but to no success.
Table:
Data Model:
Insert (doesn't work)
Beta Was this translation helpful? Give feedback.
All reactions