Closed leavestylecode closed 3 years ago
Hello, can you please tell me more about your configuration? The method should be overridden by the code generator in the actual DAO-implementations (see this generated DAO from the tests). However this only happens if the configured dialect for code generation is Mysql. This is the relevant part in the code generator:
if (schema.getDatabase().getDialect().family().equals(SQLDialect.MYSQL)) {
out.println();
out.tab(1).override();
out.tab(1).println("protected java.util.function.Function<io.vertx.sqlclient.RowSet<io.vertx.sqlclient.Row>,Long> extractMysqlLastInsertProperty(){");
out.tab(2).println("return rs -> rs.property(io.vertx.mysqlclient.MySQLClient.LAST_INSERTED_ID);");
out.tab(1).println("}");
}
My db is mariadb, so how can I fix that?
For now you would need to fork the generate-module and change the VertxGeneratorBuilder
like this:
if (schema.getDatabase().getDialect().family().equals(SQLDialect.MYSQL) || schema.getDatabase().getDialect().family().equals(SQLDialect.MARIADB)) {
out.println();
out.tab(1).override();
out.tab(1).println("protected java.util.function.Function<io.vertx.sqlclient.RowSet<io.vertx.sqlclient.Row>,Long> extractMysqlLastInsertProperty(){");
out.tab(2).println("return rs -> rs.property(io.vertx.mysqlclient.MySQLClient.LAST_INSERTED_ID);");
out.tab(1).println("}");
}
Or wait until I've implemented it.
I can wait 6.1.0 to use that😁
Should be available on maven central. Please let me know if it works for you.
Nice, It worked. 👏👏👏
When will 6.1.0 be released ? Handsome man 😅
Should be available at maven central.
leavestyle notifications@github.com schrieb am Do., 7. Jan. 2021, 07:30:
When will 6.1.0 be released ? Handsome man 😅
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jklingsporn/vertx-jooq/issues/173#issuecomment-755915856, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQLZXW4EVXQXCIECTJUBF3SYVIGTANCNFSM4VXCIQEQ .
change to classic-reactive, call
dao.insertReturningPrimary(obj)
will throw UnsupportedOperationException().I'm confused for that.