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
ConstructorDescriptionFailFastJpaConfigValidator
(javax.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil util) -
Method Summary
-
Constructor Details
-
FailFastJpaConfigValidator
public FailFastJpaConfigValidator(javax.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil util)
-
-
Method Details
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
validate
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
stop
- Specified by:
stop
in interfaceorg.springframework.context.SmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-