Global object names
Applies to ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
While jOOQ's default code generation output contains all the interesting bits for constructing queries based on type safe meta data, its String
constants for identifiers and names are not accessible to the compiler, and thus to annotation processing.
If your custom code wishes to use annotations referencing table names, column names, etc. as follows:
@MyAnnotation(MY_TABLE_NAME) class MyClass { @MyAnnotation(MY_COLUMN_NAME) String someMember; }
... then you can turn on the generation of these global names with the following configuration:
<configuration> <generator> <generate> <globalObjectNames>true</globalObjectNames> </generate> </generator> </configuration>
See the configuration XSD, standalone code generation, and maven code generation for more details.
new org.jooq.meta.jaxb.Configuration() .withGenerator( new Generate() .withGlobalObjectNames(true) )
See the configuration XSD and programmatic code generation for more details.
import org.jooq.meta.jaxb.* configuration { generator { generate { isGlobalObjectNames = true } } }
See the configuration XSD and gradle code generation for more details.
configuration { generator { generate { globalObjectNames = true } } }
See the configuration XSD and gradle code generation for more details.
generationTool { generator { generate { globalObjectNames = true } } }
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!