Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.66 KB

File metadata and controls

32 lines (25 loc) · 1.66 KB

Description:

Introduces new repository methods that contribute new persistence related behavior. This take the form of either dynamic query method fragments, or concrete implementation fragments.

Goals:

  • Demonstrate new query method fragment contribution (interface only)

  • Demonstrate new concrete method implementation fragment contribution

  • Show concrete fragment contribution example overriding JpaTrackableRepository methods for JpaProductRepository

  • Demonstrate the use of JpaTrackableRepositoryDelegateSupplier to use in the fragment for extension via composition

  • Builds On : 00200-productExtensionComplexFieldJson

Key Steps:

  • Create spring boot autoconfiguration class RepositoryCustomizationContribution, which will be referenced from META-INF/spring.factories

  • Declare the JpaTrackableRepositoryDelegateHelper bean for access to the Broadleaf repository

  • Create a new concrete repository fragment (DefaultMyAutoCoProductRepositoryConcreteContribution) and an associated interface

  • Create a new repository fragment interface (MyAutoCoProductRepositoryDynamicContribution) for the dynamic query method contribution

  • Declare a bean for the concrete fragment in the autoconfiguration class

  • Declare a RepositoryContribution bean in the autoconfiguration class, registering the new fragments with Broadleaf’s out-of-the-box repository