Using JooqTemplate requires no code generation and no XML configuration.
Add Dependency
gradle:
implementation 'net.sf.sprtool:sprtool-jooq:1.7.0'
Enter fullscreen mode
Exit fullscreen mode
maven:
<dependency> <groupId> net.sf.sprtool </groupId> <artifactId> sprtool-jooq </artifactId> <version> 1.7.0 </version> </dependency>
Enter fullscreen mode
Exit fullscreen mode
Inject JooqTemplate
import net.sf.sprtool.jooq.JooqTemplate ;
@Autowired private JooqTemplate jt ;
Enter fullscreen mode
Exit fullscreen mode
Using JooqTemplate
Inserting with a Table Object
Pass a jOOQ Table object built with DSL.table(...) as the first argument; the behavior is exactly the same as passing the table name string β with a partial-field insert, unset fields are null, and an empty Map also inserts 1 record:
import org.jooq.Table ; import org.jooq.impl.DSL ;
Table <?> productTable = DSL . table ( "product" );
Map < String , Object > product = new HashMap <>(); product .β¦