Class FactoryAutoConfig
java.lang.Object
in.co.akshitbansal.springwebquery.config.FactoryAutoConfig
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 -
Method Summary
Modifier and TypeMethodDescriptionin.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactorydtoToEntityPathMapperFactoryWithCaching(int failedResolutionsMaxCapacity, int lockStripeCount) Creates the mapper factory variant that shares resolution caches across mapper instances.in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactoryCreates the mapper factory variant that performs no caching.in.co.akshitbansal.springwebquery.tupleconverter.PreferredConstructorDiscovererFactorypreferredConstructorDiscovererFactory(boolean cachingEnabled) Creates the constructor discoverer factory used for tuple projection materialization.in.co.akshitbansal.springwebquery.tupleconverter.TupleConverterFactorytupleConverterFactory(in.co.akshitbansal.springwebquery.tupleconverter.PreferredConstructorDiscovererFactory discovererFactory) Creates the tuple converter factory used by repository projections.in.co.akshitbansal.springwebquery.ast.ValidationRSQLVisitorFactoryvalidationRSQLVisitorFactory(in.co.akshitbansal.springwebquery.pathmapper.DTOToEntityPathMapperFactory pathMapperFactory, in.co.akshitbansal.springwebquery.validator.FilterableFieldValidator filterableFieldValidator) Creates the validation visitor factory used during RSQL parsing.
-
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 resolutionslockStripeCount- 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 selectorsfilterableFieldValidator- 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
-