use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class JavaParserStereotypesTest2 method testStereotypeData.
@Test
public void testStereotypeData() {
final DtDefinition dtDefinitionAttachment = getDtDefinition("DT_COMMAND_CRITERIA");
Assert.assertNotNull(dtDefinitionAttachment);
Assert.assertEquals(DtStereotype.ValueObject, dtDefinitionAttachment.getStereotype());
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class JavaParserStereotypesTest2 method testStereotypeEntity.
/**
* Test du stereotype Data
*/
@Test
public void testStereotypeEntity() {
final DtDefinition dtDefinitionAttachment = getDtDefinition("DT_ATTACHMENT");
Assert.assertNotNull(dtDefinitionAttachment);
Assert.assertEquals(DtStereotype.Entity, dtDefinitionAttachment.getStereotype());
final DtDefinition dtDefinitionCommandValidation = getDtDefinition("DT_COMMAND_VALIDATION");
Assert.assertNotNull(dtDefinitionCommandValidation);
Assert.assertEquals(DtStereotype.Entity, dtDefinitionCommandValidation.getStereotype());
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class MultiResourcesEnvironmentManagerTest method testSplittedModules.
@Test
public void testSplittedModules() {
final AppConfig appConfig = prepareDefaultAppConfigBuilder().addModule(ModuleConfig.builder("myApp").addDefinitionProvider(DefinitionProviderConfig.builder(DynamoDefinitionProvider.class).addDefinitionResource("kpr", "io/vertigo/dynamo/environment/multi/data/execution.kpr").addDefinitionResource("classes", DtDefinitions.class.getCanonicalName()).build()).build()).build();
try (final AutoCloseableApp app = new AutoCloseableApp(appConfig)) {
final Domain doString = app.getDefinitionSpace().resolve("DO_STRING", Domain.class);
Assert.assertNotNull(doString);
final DtDefinition dtItem = app.getDefinitionSpace().resolve("DT_ITEM", DtDefinition.class);
Assert.assertNotNull(dtItem);
}
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class CacheStoreManagerInitializer method init.
/**
* {@inheritDoc}
*/
@Override
public void init() {
final DtDefinition dtDefinition = DtObjectUtil.findDtDefinition(Car.class);
storeManager.getDataStoreConfig().registerCacheable(dtDefinition, 3600, true, true);
storeManager.getDataStoreConfig().registerCacheable(DtObjectUtil.findDtDefinition(Famille.class), 120, true, true);
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class MandatoryPkValidator method checkMultiFieldConstraints.
/**
* NO checkMonoFieldConstraints.
* Can't check that PK was set in a checkMonoFieldConstraints.
* Because it was called for modified fields only, if PK is undefined it will not be checked.
*/
/**
* {@inheritDoc}
*/
@Override
protected void checkMultiFieldConstraints(final E entity, final Set<String> modifiedFieldNameSet, final DtObjectErrors dtObjectErrors) {
final DtDefinition dtDefinition = DtObjectUtil.findDtDefinition(entity);
final DtField idField = dtDefinition.getIdField().get();
final String camelCaseFieldName = getCamelCaseFieldName(idField);
if (!dtObjectErrors.hasError(camelCaseFieldName)) {
if (DtObjectUtil.getId(entity) == null) {
dtObjectErrors.addError(camelCaseFieldName, MessageText.of("Id is mandatory"));
}
}
}
Aggregations