jOOQ is a very opinionated API with respect to object orientation and how you should interact with it. In particular, you should hardly implement any types yourself if they're not clearly designated for extension purposes.
Extensible API elements include:
There's a special case that you shouldn't extend manually yourself, but indirectly via your generated code, including:
- Any base type for generated code, such as
TableImpl
That's it. Everything else is not supposed to be extended, and in fact, this information will be formally conveyed in the future by sealing the type hierarchy (see e.g. details of #14756).
This official take is also documented here, in the manual's section about semantic versioning and compatibility, specifically:
jOOQ's DSL interfaces should not be implemented by client code! Extend only those extension points that are explicitly documented as "extendable" (e.g. custom QueryParts).
To answer your specific question, DataType
is part of jOOQ's DSL and not meant for extension. Of course, as long as it is not a sealed
type yet, you can do it. The sealing won't happen in a minor release in order not to break client code. But do note that in every minor release, there will be new methods that will break your implementation, so if you still implement your own, know what you're doing. Also, you might run into an occasional ClassCastException
, because jOOQ occasionally assumes you don't extend its types, so it unsafely casts a public API type to an internal type that you can't access.
It's not unlikely that you have a use-case that could be implemented entirely differently, or with new generic SPIs and extension points, so perhaps, a feature request might be the best way forward here