Default data type conversion
One of the aspects of jOOQ that allows us to use it in a smooth manner is its default data type conversion. Most of the time, jOOQ hides from us the ceremony of converting between JDBC and Java types. For instance, have you wondered how the following explicit conversions work? Take a look:
Record1<Integer> fiscalYear = ctx.select(field("fiscal_year", Integer.class)).from(table("sale")).fetchAny(); // Offtake is a POJO Offtake offtake = ctx.select(field("fiscal_year"), field("sale"), field("employee_number")).from(table("sale")) .fetchAnyInto(Offtake.class);
Both conversions are resolved via default data type conversion or auto-conversions. Behind the scenes, jOOQ relies on its own API that is capable of performing soft type-safe conversions for Object
types, arrays, and collections...