use of org.whole.lang.models.model.DataEntity in project whole by wholeplatform.
the class RewriteQueriesTest method testDelete1.
@Test
public void testDelete1() {
Model model = new ModelsModel().create();
ITemplateManager tm = RewriteQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("delete1");
for (DataEntity dataEntity : BehaviorUtils.<DataEntity>compileAndLazyEvaluate(query, model)) assertTrue(Matcher.match(ModelsEntityDescriptorEnum.DataEntity, dataEntity));
assertFalse(BehaviorUtils.compileAndLazyEvaluate(query, model).hasNext());
}
use of org.whole.lang.models.model.DataEntity in project whole by wholeplatform.
the class RewriteQueriesTest method testUpdate1.
@Test
public void testUpdate1() {
Model model = new ModelsModel().create();
ModelDeclarations declarations = model.getDeclarations();
ITemplateManager tm = RewriteQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("update1");
for (IEntity entity : BehaviorUtils.compileAndLazyEvaluate(query, model)) assertTrue(Matcher.match(ModelsEntityDescriptorEnum.SimpleName, entity) || Matcher.match(ModelsEntityDescriptorEnum.DataType, entity));
assertEquals("MyModelName", model.getName().getValue());
int j = 0;
for (int i = 0; i < declarations.wSize(); i++) {
IEntity decl = declarations.wGet(i);
if (Matcher.match(ModelsEntityDescriptorEnum.DataEntity, decl)) {
if (j++ == 0) {
assertEquals("MyFirstName", ((DataEntity) decl).getName().getValue());
assertEquals("MyFirstDataType", ((DataEntity) decl).getDataType().getValue());
} else {
assertEquals("MySecondName", ((DataEntity) decl).getName().getValue());
return;
}
}
}
}
use of org.whole.lang.models.model.DataEntity in project whole by wholeplatform.
the class DataEntityTablePart method refreshVisuals.
@Override
protected void refreshVisuals() {
DataEntity entity = getModelEntity();
getFigure().showKeyword(!EntityUtils.isNotResolver(entity.getDataType()));
}
Aggregations