Class FailFastJpaConfigValidator
java.lang.Object
com.broadleafcommerce.data.tracking.jpa.validation.FailFastJpaConfigValidator
- All Implemented Interfaces:
org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class FailFastJpaConfigValidator
extends Object
implements org.springframework.context.SmartLifecycle
Validation class that runs at system startup and determines if there are any JPA entity
configuration problems detected with entity classes registered with Spring Data. The primary
check is to determine if there are any
@OneToOne or @ManyToOne relationships
declared from a @Trackable entity (with behavior of TrackableBehavior.SANDBOX or
TrackableBehavior.CATALOG) to another @Trackable entity with similar behavior.
This type of relationship is not allowed, as those types of combinations cannot be effectively
narrowed.-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionFailFastJpaConfigValidator(jakarta.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil util) -
Method Summary
-
Constructor Details
-
FailFastJpaConfigValidator
public FailFastJpaConfigValidator(jakarta.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil util)
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
validate
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-