Class JpaSupportAutoConfigure

java.lang.Object
com.totvs.tjf.autoconfigure.JpaSupportAutoConfigure
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@AutoConfigureAfter(org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration.class) public class JpaSupportAutoConfigure extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Enables the EnableSpringDataWebSupport and load the JpaApiModule to register the serializers and deserializers to support the TOTVS API Guide format for page responses.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    JpaSupportAutoConfigure(org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties properties, Optional<Integer> defaultPageSize, Optional<Integer> maximumPageSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> resolvers)
    Adds the custom SortArgumentResolver for standalone resolutions or in conjunction with PageableArgumentResolver.
    void
    addFormatters(org.springframework.format.FormatterRegistry registry)
    Adds ZonedDateTime to LocalDate converter in Spring Data projections conversion service
    Setup a JpaApiModule instance to be used by the application.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    addCorsMappings, addInterceptors, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
  • Field Details

  • Constructor Details

    • JpaSupportAutoConfigure

      public JpaSupportAutoConfigure(org.springframework.boot.autoconfigure.data.web.SpringDataWebProperties properties, @Value("${tjf.api.context.default.pagesize:#{null}}") Optional<Integer> defaultPageSize, @Value("${tjf.api.context.maximum-page-size:#{null}}") Optional<Integer> maximumPageSize)
  • Method Details

    • jpaApiModule

      @Bean public JpaApiModule jpaApiModule()
      Setup a JpaApiModule instance to be used by the application.
      Returns:
      standard SliceJsonSerializer instance to be used by the application.
    • addArgumentResolvers

      public void addArgumentResolvers(List<org.springframework.web.method.support.HandlerMethodArgumentResolver> resolvers)
      Adds the custom SortArgumentResolver for standalone resolutions or in conjunction with PageableArgumentResolver.

      Note: Both resolvers are add in preference off the framework default.

      Specified by:
      addArgumentResolvers in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • addFormatters

      public void addFormatters(org.springframework.format.FormatterRegistry registry)
      Adds ZonedDateTime to LocalDate converter in Spring Data projections conversion service
      Specified by:
      addFormatters in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer