Open InfoSec812 opened 3 years ago
Hmmm... Some more information... The actual insertion of the data in the table is successful, it is just the returning of the ID field which causes a problem.
This seems to be unrelated to the insertReturningPrimary
and is instead related to the generated RowMapper
which looks like:
public class RowMappers {
private RowMappers(){}
public static Function<Row,com.redhat.runtimes.data.access.tables.pojos.Todos> getTodosMapper() {
return row -> {
com.redhat.runtimes.data.access.tables.pojos.Todos pojo = new com.redhat.runtimes.data.access.tables.pojos.Todos();
pojo.setId(row.getUUID("ID"));
pojo.setAuthor(row.getString("AUTHOR"));
pojo.setComplete(row.getBoolean("COMPLETE"));
pojo.setCreated(row.getLocalDateTime("CREATED"));
pojo.setDescription(row.getString("DESCRIPTION"));
pojo.setDuedate(row.getLocalDateTime("DUEDATE"));
pojo.setTitle(row.getString("TITLE"));
return pojo;
};
}
public static Function<Row,com.redhat.runtimes.data.access.tables.pojos.Users> getUsersMapper() {
return row -> {
com.redhat.runtimes.data.access.tables.pojos.Users pojo = new com.redhat.runtimes.data.access.tables.pojos.Users();
pojo.setId(row.getUUID("ID"));
pojo.setFamilyname(row.getString("FAMILYNAME"));
pojo.setGivenname(row.getString("GIVENNAME"));
pojo.setName(row.getString("NAME"));
pojo.setPreferredusername(row.getString("PREFERREDUSERNAME"));
return pojo;
};
}
}
The calls to row.getXXX()
are using uppercase field names and those are not matching the field names from the PostgreSQL Reactive client which are in lower case.
I am generating jOOQ DAOs using JPADatabase in my example project
For some reason, when I try to create a new row/record using the DAO's
insertReturningPrimary
method, I get the following error:I have tried tweaking the
Configuration
to change how names/fields/schemas are rendered with respect to letter case, but it's pretty hit and miss (Mostly miss) so far. In my database, the column isid
(lower case) and when jOOQ attempts to fetch the column is it asking forID
(upper case) atio.vertx.sqlclient.Row.getValue(Row.java:65)
at which point it fails.Any advice? If you would like to run the example project:
Issue-7-_-Debug_createTodo_operation
branch:git checkout Issue-7-_-Debug_createTodo_operation
mvn clean compile
docker-compose up
in the root of the projectmvn -pl modules/api clean compile vertx:run