A default implementation for code generation. Replace this code with your own logic, if you need your database schema represented in a different way. Note that you can also extend this class to generate POJO's or other stuff entirely independent of jOOQ. @author Lukas Eder
| 255 | * @author Lukas Eder |
| 256 | */ |
| 257 | public class JavaGenerator extends AbstractGenerator { |
| 258 | |
| 259 | private static final JooqLogger log = JooqLogger.getLogger(JavaGenerator.class); |
| 260 | |
| 261 | /** |
| 262 | * Dialects that can reference tables in contexts where UDTs are expected. |
| 263 | */ |
| 264 | private static final Set<SQLDialect> SUPPORT_TABLE_AS_UDT = SQLDialect.supportedBy(POSTGRES, YUGABYTEDB); |
| 265 | |
| 266 | /** |
| 267 | * The Javadoc to be used for private constructors |
| 268 | */ |
| 269 | private static final String NO_FURTHER_INSTANCES_ALLOWED = "No further instances allowed"; |
| 270 | |
| 271 | /** |
| 272 | * [#4429] A map providing access to SQLDataType member literals |
| 273 | */ |
| 274 | private static final Map<DataType<?>, String> SQLDATATYPE_LITERAL_LOOKUP; |
| 275 | |
| 276 | /** |
| 277 | * [#6411] A set providing access to SQLDataTypes that can have length. |
| 278 | */ |
| 279 | private static final Set<String> SQLDATATYPE_WITH_LENGTH; |
| 280 | |
| 281 | /** |
| 282 | * [#6411] A set providing access to SQLDataTypes that can have precision |
| 283 | * (and scale). |
| 284 | */ |
| 285 | private static final Set<String> SQLDATATYPE_WITH_PRECISION; |
| 286 | |
| 287 | /** |
| 288 | * Some reusable type references. |
| 289 | */ |
| 290 | private static final String KLIST = "kotlin.collections.List"; |
| 291 | private static final String KMUTABLELIST = "kotlin.collections.MutableList"; |
| 292 | |
| 293 | private static final Set<String> PRIMITIVE_WRAPPERS = new HashSet<>(Arrays.asList( |
| 294 | Byte.class.getName(), |
| 295 | Short.class.getName(), |
| 296 | Integer.class.getName(), |
| 297 | Long.class.getName(), |
| 298 | Float.class.getName(), |
| 299 | Double.class.getName(), |
| 300 | Boolean.class.getName(), |
| 301 | Character.class.getName(), |
| 302 | "kotlin.Byte", |
| 303 | "kotlin.Short", |
| 304 | "kotlin.Int", |
| 305 | "kotlin.Long", |
| 306 | "kotlin.Float", |
| 307 | "kotlin.Double", |
| 308 | "kotlin.Boolean", |
| 309 | "kotlin.Char" |
| 310 | )); |
| 311 | |
| 312 | /** |
| 313 | * An overall stop watch to measure the speed of source code generation |
| 314 | */ |
nothing calls this directly
no test coverage detected
searching dependent graphs…