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

      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

      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

      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; plans use the same mapping rules but are compiled without retention.

      Parameters:
      planCachingEnabled - whether an internal "mapping plan" cache should be used to speed up ResultSet mapping
      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 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
    • maxLobBytes

      Limits each BLOB value materialized by the default mapper as byte[]. Defaults to 16 MiB. The limit does not cover driver buffering, custom mappers, ordinary binary columns, or the aggregate size of a result list. This setter enables the binary limit even after unboundedLobMaterialization().
      Parameters:
      maxLobBytes - strictly positive maximum byte count
      Returns:
      this builder
      Since:
      4.8.0
    • maxLobCharacters

      Limits each CLOB/NCLOB value materialized by the default mapper as String. Defaults to 8,388,608 UTF-16 code units. The limit does not cover driver buffering, custom mappers, ordinary character columns, or the aggregate size of a result list. This setter enables the character limit even after unboundedLobMaterialization().
      Parameters:
      maxLobCharacters - strictly positive maximum UTF-16 code-unit count
      Returns:
      this builder
      Since:
      4.8.0
    • unboundedLobMaterialization

      Disables both configurable LOB limits. Java array and string size limits still apply. Later calls to either finite-limit setter re-enable that limit independently.
      Returns:
      this builder
      Since:
      4.8.0
    • 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 to 0
      Returns:
      this Builder, for chaining
    • build

      Constructs a default ResultSetMapper instance.

      The constructed instance is thread-safe.

      Returns:
      a ResultSetMapper instance