Class CachedDTOAwareFieldResolver

java.lang.Object
in.co.akshitbansal.springwebquery.resolver.field.DTOAwareFieldResolver
in.co.akshitbansal.springwebquery.resolver.field.cache.CachedDTOAwareFieldResolver
All Implemented Interfaces:
FieldResolver

public class CachedDTOAwareFieldResolver extends DTOAwareFieldResolver
DTOAwareFieldResolver variant that caches DTO-path resolution outcomes.

Successful resolutions are memoized by CacheKey, and a per-key lock is used to avoid duplicate reflective resolution work when multiple threads request the same path concurrently.

  • Constructor Details

    • CachedDTOAwareFieldResolver

      public CachedDTOAwareFieldResolver(@NonNull @NonNull Class<?> entityClass, @NonNull @NonNull Class<?> dtoClass, @NonNull @NonNull DTOAwareFieldResolutionCache cache)
      Creates a cached DTO-aware field resolver for a single query contract.
      Parameters:
      entityClass - entity type used to validate mapped paths
      dtoClass - DTO type exposed to API callers
      cache - shared cache for resolution results
  • Method Details

    • resolvePath

      public ResolutionResult resolvePath(@NonNull @NonNull String dtoPath)
      Resolves the supplied DTO selector path, consulting and populating the shared cache around the superclass's reflective resolution logic.
      Specified by:
      resolvePath in interface FieldResolver
      Overrides:
      resolvePath in class DTOAwareFieldResolver
      Parameters:
      dtoPath - selector path from the incoming request
      Returns:
      resolution result containing the mapped entity path and terminal DTO field