Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.76 KB

File metadata and controls

37 lines (30 loc) · 1.76 KB

Description:

Introduction of new domain including explicit projection declaration

Goals:

Key Steps:

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

  • Setup domain (see 1600-newDomainComplexField)

  • Additionally, make ChargingStation implements BusinessTypeAware and ModelMapperMappable

  • Create a projection class (ChargingStationProjection)

  • Implement getBusinessDomainType() in ChargingStation and return ChargingStationProjection as the type

  • Implement toMe/fromMe in ChargingStation (from ModelMapperMappable contract)

    • ModelMapper will automatically map similar fields

    • For unusual mappings, use a post converter

    • Create a ModelMapper type map for your repository domain and projection and register your post converter

  • Declare @EnableJpaTrackableFlow on the autoconfiguration class to setup the lifecycle plumbing for the new domain class

  • Declare @AutoConfigureBefore on the autoconfiguration class to scan the new domain class before JPA processing