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@OneToOneor@ManyToOnerelationships declared from a@Trackableentity (with behavior ofTrackableBehavior.SANDBOXorTrackableBehavior.CATALOG) to another@Trackableentity with similar behavior. This type of relationship is not allowed, as those types of combinations cannot be effectively narrowed.
-
-
Constructor Summary
Constructors Constructor Description FailFastJpaConfigValidator(javax.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil util)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPhase()booleanisAutoStartup()booleanisRunning()voidstart()voidstop()voidstop(Runnable callback)protected voidvalidate(Class<?> javaType, boolean autoConsiderTrackable)
-
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
validate
protected void validate(Class<?> javaType, boolean autoConsiderTrackable)
-
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
public void stop(Runnable callback)
- 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
-
-