Class ModelDataImpactValidator
java.lang.Object
io.jmix.dynmodelai.validation.impl.ModelDataImpactValidator
Checks how the drafted changes collide with data that already exists in the running application.
The one case migration planning does not cover: a required attribute on an entity whose
existing rows have no value for it, either because the attribute is new or because a published
optional attribute becomes required. The requirement is metadata-only — no database NOT NULL
is created and existing rows are not pre-checked — so every such record fails validation the next
time a user tries to save it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DataManagerprotected final DynamicModelToolsprotected final MetadataGenerationManagerprotected final StoreAwareLocatorprotected final SystemAuthenticator -
Constructor Summary
ConstructorsConstructorDescriptionModelDataImpactValidator(DataManager dataManager, MetadataGenerationManager metadataGenerationManager, SystemAuthenticator systemAuthenticator, DynamicModelTools dynamicModelTools, StoreAwareLocator storeAwareLocator, Messages messages) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected booleanhasRowsWithoutValue(MetaClass metaClass, MetaProperty property) JPQL conditions on dynamic attributes are not applied, so the published column is counted directly.validate(DynamicModelDefinition draft)
-
Field Details
-
dataManager
-
metadataGenerationManager
-
systemAuthenticator
-
dynamicModelTools
-
storeAwareLocator
-
-
Constructor Details
-
ModelDataImpactValidator
public ModelDataImpactValidator(DataManager dataManager, MetadataGenerationManager metadataGenerationManager, SystemAuthenticator systemAuthenticator, DynamicModelTools dynamicModelTools, StoreAwareLocator storeAwareLocator, Messages messages)
-
-
Method Details
-
validate
-
hasRowsWithoutValue
JPQL conditions on dynamic attributes are not applied, so the published column is counted directly. -
hasRows
-