Class ResultSetMapper.Builder

java.lang.Object
com.pyranid.ResultSetMapper.Builder
Enclosing interface:
ResultSetMapper

@NotThreadSafe public static class ResultSetMapper.Builder extends Object
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 Details

    • normalizationLocale

      public @NonNull ResultSetMapper.Builder normalizationLocale(@NonNull Locale 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 a List of custom column-specific mapping logic to apply, in priority order.
      Parameters:
      customColumnMappers - a List of custom column-specific mapping logic to apply, in priority order
      Returns:
      this Builder, for chaining
    • planCachingEnabled

      public @NonNull ResultSetMapper.Builder planCachingEnabled(@NonNull Boolean planCachingEnabled)
      Specifies whether an internal "mapping plan" cache should be used to speed up ResultSet mapping.

      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 up ResultSet mapping
      Returns:
      this Builder, for chaining
    • planCacheCapacity

      public @NonNull ResultSetMapper.Builder planCacheCapacity(@NonNull Integer planCacheCapacity)
      Specifies the maximum number of row-mapping plans to cache per result class when plan caching is enabled.

      Use 0 for an unbounded cache.

      Parameters:
      planCacheCapacity - maximum number of cached plans per result class, or 0 for unbounded. Defaults to ResultSetMapper.DEFAULT_PLAN_CACHE_CAPACITY.
      Returns:
      this Builder, for chaining
    • preferredColumnMapperCacheCapacity

      public @NonNull ResultSetMapper.Builder preferredColumnMapperCacheCapacity(@NonNull Integer preferredColumnMapperCacheCapacity)
      Specifies the maximum number of cached preferred custom column mappers per source class.

      This cache does not change the priority order in which custom column mappers are tried.

      Use 0 for an unbounded cache.

      Parameters:
      preferredColumnMapperCacheCapacity - maximum number of cached preferred custom column mappers per source class, or 0 for unbounded. Defaults to ResultSetMapper.DEFAULT_PREFERRED_COLUMN_MAPPER_CACHE_CAPACITY.
      Returns:
      this Builder, for chaining
    • build

      public @NonNull ResultSetMapper build()
      Constructs a default ResultSetMapper instance.

      The constructed instance is thread-safe.

      Returns:
      a ResultSetMapper instance