Class FactoryAutoConfig

java.lang.Object
in.co.akshitbansal.springwebquery.config.FactoryAutoConfig

@AutoConfiguration public class FactoryAutoConfig extends Object
Auto-configuration that wires the core factories used by query validation and DTO/entity path translation.

This configuration also exposes the factories used to discover DTO constructors and create tuple converters for projected query results.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory
    dtoToEntityPathMapperFactoryWithCaching(int failedResolutionsMaxCapacity, int lockStripeCount)
    Creates the mapper factory variant that shares resolution caches across mapper instances.
    in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory
    Creates the mapper factory variant that performs no caching.
    in.co.akshitbansal.springwebquery.tupleconverter.PreferredConstructorDiscovererFactory
    preferredConstructorDiscovererFactory(boolean cachingEnabled)
    Creates the constructor discoverer factory used for tuple projection materialization.
    in.co.akshitbansal.springwebquery.tupleconverter.TupleConverterFactory
    tupleConverterFactory(in.co.akshitbansal.springwebquery.tupleconverter.PreferredConstructorDiscovererFactory discovererFactory)
    Creates the tuple converter factory used by repository projections.
    in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactory
    validationRSQLVisitorFactory(in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory pathMapperFactory, in.co.akshitbansal.springwebquery.validator.FilterableFieldValidator filterableFieldValidator)
    Creates the validation visitor factory used during RSQL parsing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FactoryAutoConfig

      public FactoryAutoConfig()
  • Method Details

    • dtoToEntityPathMapperFactoryWithCaching

      @Bean @ConditionalOnProperty(name="spring-web-query.field-resolution.caching.enabled", havingValue="true", matchIfMissing=true) public in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory dtoToEntityPathMapperFactoryWithCaching(@Value("${spring-web-query.field-resolution.caching.failed-resolutions-max-capacity:1000}") int failedResolutionsMaxCapacity, @Value("${spring-web-query.field-resolution.caching.lock-stripe-count:32}") int lockStripeCount)
      Creates the mapper factory variant that shares resolution caches across mapper instances.
      Parameters:
      failedResolutionsMaxCapacity - maximum cached failed resolutions
      lockStripeCount - number of striped locks used during cache fills
      Returns:
      cached mapper factory
    • dtoToEntityPathMapperFactoryWithoutCaching

      @Bean @ConditionalOnProperty(name="spring-web-query.field-resolution.caching.enabled", havingValue="false") public in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory dtoToEntityPathMapperFactoryWithoutCaching()
      Creates the mapper factory variant that performs no caching.
      Returns:
      uncached mapper factory
    • validationRSQLVisitorFactory

      @Bean public in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactory validationRSQLVisitorFactory(in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory pathMapperFactory, in.co.akshitbansal.springwebquery.validator.FilterableFieldValidator filterableFieldValidator)
      Creates the validation visitor factory used during RSQL parsing.
      Parameters:
      pathMapperFactory - mapper factory used to resolve DTO selectors
      filterableFieldValidator - validator used for field-level filtering rules
      Returns:
      validation visitor factory
    • preferredConstructorDiscovererFactory

      @Bean public in.co.akshitbansal.springwebquery.tupleconverter.PreferredConstructorDiscovererFactory preferredConstructorDiscovererFactory(@Value("${spring-web-query.constructor-discovery.caching.enabled:true}") boolean cachingEnabled)
      Creates the constructor discoverer factory used for tuple projection materialization.
      Parameters:
      cachingEnabled - whether constructor discovery should share a global cache across converter instances
      Returns:
      constructor discoverer factory configured for cached or uncached operation
    • tupleConverterFactory

      @Bean public in.co.akshitbansal.springwebquery.tupleconverter.TupleConverterFactory tupleConverterFactory(in.co.akshitbansal.springwebquery.tupleconverter.PreferredConstructorDiscovererFactory discovererFactory)
      Creates the tuple converter factory used by repository projections.
      Parameters:
      discovererFactory - constructor discoverer factory used to back new converters
      Returns:
      tuple converter factory