use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class ItemSearchLoader method loadData.
/**
* {@inheritDoc}
*/
@Override
public List<SearchIndex<Item, Item>> loadData(final SearchChunk<Item> searchChunk) {
final SearchIndexDefinition indexDefinition = searchManager.findFirstIndexDefinitionByKeyConcept(Item.class);
try (final VTransactionWritable tx = getTransactionManager().createCurrentTransaction()) {
final List<SearchIndex<Item, Item>> result = new ArrayList<>();
final DtDefinition dtDefinition = DtObjectUtil.findDtDefinition(Item.class);
for (final Item item : loadItems(searchChunk)) {
final URI<Item> uri = new URI<>(dtDefinition, item.getId());
result.add(SearchIndex.createIndex(indexDefinition, uri, item));
}
return result;
}
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class JavaEnvironmentManagerTest method testCommand.
@Test
public void testCommand() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final DtDefinition dtDefinition = definitionSpace.resolve("DT_COMMAND", DtDefinition.class);
Assert.assertTrue(dtDefinition.isPersistent());
Assert.assertEquals("io.vertigo.dynamo.environment.java.data.domain.Command", dtDefinition.getClassCanonicalName());
Assert.assertEquals("io.vertigo.dynamo.environment.java.data.domain", dtDefinition.getPackageName());
Assert.assertEquals("Command", dtDefinition.getClassSimpleName());
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class JavaEnvironmentManagerTest method testCityFragment.
@Test
public void testCityFragment() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final DtDefinition dtDefinition = definitionSpace.resolve("DT_CITY_FRAGMENT", DtDefinition.class);
Assert.assertFalse(dtDefinition.isPersistent());
Assert.assertTrue(dtDefinition.getFragment().isPresent());
Assert.assertTrue("City".equals(dtDefinition.getFragment().get().getClassSimpleName()));
Assert.assertEquals("io.vertigo.dynamo.environment.java.data.domain.CityFragment", dtDefinition.getClassCanonicalName());
Assert.assertEquals("io.vertigo.dynamo.environment.java.data.domain", dtDefinition.getPackageName());
Assert.assertEquals("CityFragment", dtDefinition.getClassSimpleName());
Assert.assertTrue("City".equals(dtDefinition.getField("CIT_ID").getFkDtDefinition().getClassSimpleName()));
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class JavaParserStereotypesTest method testStereotypeKeyConcept.
/**
* Test du stereotype keyConcept
*/
@Test
public void testStereotypeKeyConcept() {
final DtDefinition dtDefinitionCommand = getDtDefinition("DT_COMMAND");
Assert.assertNotNull(dtDefinitionCommand);
Assert.assertEquals(DtStereotype.KeyConcept, dtDefinitionCommand.getStereotype());
}
use of io.vertigo.dynamo.domain.metamodel.DtDefinition in project vertigo by KleeGroup.
the class JavaParserStereotypesTest2 method testStereotypeKeyConcept.
/**
* Test du stereotype keyConcept
*/
@Test
public void testStereotypeKeyConcept() {
final DtDefinition dtDefinitionCommand = getDtDefinition("DT_COMMAND");
Assert.assertNotNull(dtDefinitionCommand);
Assert.assertEquals(DtStereotype.KeyConcept, dtDefinitionCommand.getStereotype());
}
Aggregations