Open termermc opened 1 year ago
When using postgres, vertx-jooq
assumes that all converters implement the io.github.jklingsporn.vertx.jooq.shared.postgres.PgConverter
. I'm afraid this is not documented. The main issue when using the reactive driver together with jooq is, that we have potentially three different types we have to convert between:
userType
)For example, imagine you have a POJO and it has a property called user
which is represented by a JSONB-column in the database. You want to map that JSON to another POJO, called my.example.User
, then
my.example.User
org.jooq.JSONB
io.vertx.core.json.JsonObject
Here is an example: https://github.com/jklingsporn/vertx-jooq/blob/master/vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate/converter/SomeJsonPojoConverter.java
Would this mean a custom converter would need to be used? I imagine that ther ecould be some reflection done by the generator to check whether the converter implements PgConverter, or whether it's a default jOOQ one. In that case a wrapper class could possibly be generated for it.
If that's not possible, would that mean a custom converter would need to be written? That seems less than ideal considering the converter for the inet
type is built into jOOQ and I belive just needs to be converted into a String.
Let me know if I'm not underestanding anything correctly.
Feel free to contribute 🚀 The problem I see with reflection is that at the time of generation the generated code is not on the classpath of the (vertx-) jOOQ-Codegenerator and thus cannot be instantiated. For example when using the generator as a maven-plugin, your module has a dependency to it. But the generator itself is not aware of any custom converters you wrote. Instead, it generates (think of writing a text-file) class-files and puts them into a location of your choice.
Hello. I've just started evaluating this library, and I have noticed that there is an issue with the code generated for
RowMappers.java
when dealing with table that have column(s) of typeinet
.I have the necessary PostgreSQL jOOQ extensions installed, and have set up the ForcedType for it:
Here is the problematic part of
RowMappers.java
:rowConverter()
is not a method onORG_JOOQ_POSTGRES_EXTENSIONS_CONVERTERS_INETCONVERTER_INSTANCE
.There are also other related errors on the Login table object with
ip
.Is there something obvious that I am missing? If there is some work to be done to support this, I would be happy to contribute.
Thank you.