Available in versions: Dev (3.19)
This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Inline database implementation
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
Instead of providing your own Database
implementation as a pre-compiled class to the code generation classpath, you can also provide an inline implementation (see in-memory compilation for more details):
<configuration> <generator> <database> <name>com.example.MyDatabase</name> <java>package com.example; import org.jooq.meta.AbstractDatabase; public class MyDatabase extends AbstractDatabase { ... }</java> </database> </generator> </configuration>
See the configuration XSD, standalone code generation, and maven code generation for more details.
new org.jooq.meta.jaxb.Configuration() .withGenerator(new Generator() .withDatabase(new Database() .withName("com.example.MyDatabase") .withJava("package com.example;" + "import org.jooq.meta.AbstractDatabase;" + "public class MyDatabase extends AbstractDatabase {" + "..." + "}") ) )
See the configuration XSD andprogrammatic code generation for more details.
generationTool { generator { database { name = 'com.example.MyDatabase' java = '''package com.example; import org.jooq.meta.AbstractDatabase; public class MyDatabase extends AbstractDatabase { ... }''' } } }
See the configuration XSD and gradle code generation for more details.
Feedback
Do you have any feedback about this page? We'd love to hear it!