Class ResultSetMapper.Builder
java.lang.Object
com.pyranid.ResultSetMapper.Builder
- Enclosing interface:
ResultSetMapper
Builder used to construct a standard implementation of
ResultSetMapper.
This class is intended for use by a single thread.
- Since:
- 3.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescription@NonNull ResultSetMapperbuild()Constructs a defaultResultSetMapperinstance.@NonNull ResultSetMapper.BuildercustomColumnMappers(@NonNull List<@NonNull CustomColumnMapper> customColumnMappers) Specifies aListof custom column-specific mapping logic to apply, in priority order.@NonNull ResultSetMapper.BuildernormalizationLocale(@NonNull Locale normalizationLocale) Specifies the locale to use when massaging JDBC column names for matching against Java property names.@NonNull ResultSetMapper.BuilderplanCacheCapacity(@NonNull Integer planCacheCapacity) Specifies the maximum number of row-mapping plans to cache per result class when plan caching is enabled.@NonNull ResultSetMapper.BuilderplanCachingEnabled(@NonNull Boolean planCachingEnabled) Specifies whether an internal "mapping plan" cache should be used to speed upResultSetmapping.@NonNull ResultSetMapper.BuilderpreferredColumnMapperCacheCapacity(@NonNull Integer preferredColumnMapperCacheCapacity) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
normalizationLocale
Specifies the locale to use when massaging JDBC column names for matching against Java property names.- Parameters:
normalizationLocale- the locale to use when massaging JDBC column names for matching against Java property names- Returns:
- this
Builder, for chaining
-
customColumnMappers
public @NonNull ResultSetMapper.Builder customColumnMappers(@NonNull List<@NonNull CustomColumnMapper> customColumnMappers) Specifies aListof custom column-specific mapping logic to apply, in priority order.- Parameters:
customColumnMappers- aListof custom column-specific mapping logic to apply, in priority order- Returns:
- this
Builder, for chaining
-
planCachingEnabled
Specifies whether an internal "mapping plan" cache should be used to speed upResultSetmapping.Disabling plan caching is primarily useful for highly dynamic schemas; the non-planned path allocates per-row maps and does more reflection.
- Parameters:
planCachingEnabled- whether an internal "mapping plan" cache should be used to speed upResultSetmapping- Returns:
- this
Builder, for chaining
-
planCacheCapacity
Specifies the maximum number of row-mapping plans to cache per result class when plan caching is enabled.Use
0for an unbounded cache.- Parameters:
planCacheCapacity- maximum number of cached plans per result class, or0for unbounded. Defaults toResultSetMapper.DEFAULT_PLAN_CACHE_CAPACITY.- Returns:
- this
Builder, for chaining
-
preferredColumnMapperCacheCapacity
@Deprecated(since="4.5.0", forRemoval=true) public @NonNull ResultSetMapper.Builder preferredColumnMapperCacheCapacity(@NonNull Integer preferredColumnMapperCacheCapacity) Deprecated, for removal: This API element is subject to removal in a future version.Retained for source and binary compatibility. This setting has no effect.Pyranid always evaluates applicable custom column mappers in their configured priority order. This method is deprecated and will be removed in 5.0.0.
- Parameters:
preferredColumnMapperCacheCapacity- ignored compatibility value; must be greater than or equal to0- Returns:
- this
Builder, for chaining
-
build
Constructs a defaultResultSetMapperinstance.The constructed instance is thread-safe.
- Returns:
- a
ResultSetMapperinstance
-