Class ConditionalFieldAnnotationsClassTransformer

java.lang.Object
org.broadleafcommerce.common.extensibility.jpa.copy.AbstractClassTransformer
org.broadleafcommerce.common.extensibility.jpa.copy.ConditionalFieldAnnotationsClassTransformer
All Implemented Interfaces:
jakarta.persistence.spi.ClassTransformer, BroadleafClassTransformer, org.springframework.beans.factory.InitializingBean

public class ConditionalFieldAnnotationsClassTransformer extends AbstractClassTransformer implements BroadleafClassTransformer
The purpose of this class is to allow the conditional addition or removal of annotations to a target entity based on template class.

This does not add new fields or methods, nor does it remove fields or methods. Rather, this class copies annotations from a template class' field(s) to a target class' fields. It removes annotations from the target that are not on the template.

As a result, this class takes the annotations from fields of a template class and adds them to fields in a target class. If the template contains fields that are not on the target, then unexpected behavior such as NullPointerExceptions may occur.

Author:
Kelly Tisdell