[jOOQ/jOOQ#18949] Add Javadoc to various SPIs about an expectation for them to be side-effect free and thus cacheable

This commit is contained in:
Lukas Eder 2025-08-29 11:54:56 +02:00
parent 6473f1aa1c
commit 3f744cb0bb
2 changed files with 19 additions and 0 deletions

View File

@ -50,6 +50,15 @@ import org.jetbrains.annotations.Nullable;
* {@link RecordMapper}, e.g. when mapping {@link JSON} or {@link XML} data
* types onto POJO types using third party libraries like Jackson, Gson, JAXB,
* or others.
* <p>
* The general expectation is for a {@link ConverterProvider} to be side-effect
* free. Two calls to {@link #provide(Class, Class)} should always produce the
* same {@link Converter} logic and thus conversion behaviour, irrespective of
* context, other than the {@link Configuration} that hosts the
* {@link Configuration#converterProvider()}. This effectively means that it is
* possible for jOOQ to cache the outcome of a {@link #provide(Class, Class)}
* call within the context of a {@link Configuration} or any derived context,
* such as an {@link ExecuteContext}, to greatly improve performance.
*
* @author Lukas Eder
*/

View File

@ -83,6 +83,16 @@ import org.jetbrains.annotations.NotNull;
* While not strictly required, it is advisable to implement a
* <code>RecordMapperProvider</code> whose behaviour is consistent with the
* configured {@link RecordUnmapperProvider}.
* <p>
* The general expectation is for a {@link RecordMapperProvider} to be
* side-effect free. Two calls to {@link #provide(RecordType, Class)} should
* always produce the same {@link RecordMapper} logic and thus mapping
* behaviour, irrespective of context, other than the {@link Configuration} that
* hosts the {@link Configuration#recordMapperProvider()}. This effectively
* means that it is possible for jOOQ to cache the outcome of a
* {@link #provide(RecordType, Class)} call within the context of a
* {@link Configuration} or any derived context, such as an
* {@link ExecuteContext}, to greatly improve performance.
*
* @author Lukas Eder
* @see RecordMapper