use of io.vertigo.dynamo.domain.metamodel.Domain in project vertigo by KleeGroup.
the class ItemSearchLoader method getTaskDefinition.
private TaskDefinition getTaskDefinition(final SearchChunk<Item> searchChunk) {
final Domain doItems = definitionSpace.resolve("DO_DT_ITEM_DTC", Domain.class);
final String sql = searchChunk.getAllURIs().stream().map(uri -> uri.getId().toString()).collect(Collectors.joining(", ", "select * from ITEM where ID in (", ")"));
return TaskDefinition.builder("TK_LOAD_ALL_ITEMS").withEngine(TaskEngineSelect.class).withRequest(sql).withPackageName(TaskEngineSelect.class.getPackage().getName()).withOutRequired("dtc", doItems).build();
}
use of io.vertigo.dynamo.domain.metamodel.Domain in project vertigo by KleeGroup.
the class AbstractStoreManagerTest method nativeInsertCar.
protected void nativeInsertCar(final Car car) {
Assertion.checkArgument(car.getId() == null, "L'id n'est pas null {0}", car.getId());
// -----
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final Domain doCar = definitionSpace.resolve("DO_DT_CAR_DTO", Domain.class);
final TaskDefinition taskDefinition = TaskDefinition.builder("TK_INSERT_CAR").withEngine(TaskEngineProc.class).withRequest("insert into CAR (ID, FAM_ID,MANUFACTURER, MODEL, DESCRIPTION, YEAR, KILO, PRICE, MTY_CD) values " + "(NEXT VALUE FOR SEQ_CAR, #DTO_CAR.FAM_ID#, #DTO_CAR.MANUFACTURER#, #DTO_CAR.MODEL#, #DTO_CAR.DESCRIPTION#, #DTO_CAR.YEAR#, #DTO_CAR.KILO#, #DTO_CAR.PRICE#, #DTO_CAR.MTY_CD#)").addInRequired("DTO_CAR", doCar).build();
final Task task = Task.builder(taskDefinition).addValue("DTO_CAR", car).build();
final TaskResult taskResult = taskManager.execute(task);
nop(taskResult);
}
use of io.vertigo.dynamo.domain.metamodel.Domain in project vertigo by KleeGroup.
the class TaskDefinitionProvider method buildTaskDefinition2.
private TaskDefinition buildTaskDefinition2(final DefinitionSpace definitionSpace, final String taskDefinitionName, final String params) {
final Domain doIntegers = definitionSpace.resolve("DO_INTEGERS", Domain.class);
final Domain doInteger = definitionSpace.resolve("DO_INTEGER", Domain.class);
return TaskDefinition.builder(taskDefinitionName).withEngine(TaskEngineMock2.class).withRequest(params).withPackageName(TaskEngineMock.class.getPackage().getName()).addInRequired(ATTR_IN_INTEGERS, doIntegers).withOutRequired(ATTR_OUT, doInteger).build();
}
use of io.vertigo.dynamo.domain.metamodel.Domain in project vertigo by KleeGroup.
the class JavaEnvironmentManagerTest method testDomain.
@Test
public void testDomain() {
final DefinitionSpace definitionSpace = getApp().getDefinitionSpace();
final io.vertigo.dynamo.domain.metamodel.Domain domain = definitionSpace.resolve("DO_ID", Domain.class);
Assert.assertEquals(DataType.Long, domain.getDataType());
Assert.assertEquals(FormatterDefault.class.getName(), domain.getFormatterClassName());
}
use of io.vertigo.dynamo.domain.metamodel.Domain 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);
}
}
Aggregations