use of com.haulmont.chile.core.model.Session in project cuba by cuba-platform.
the class MetadataTest method test.
@Test
public void test() {
Session session = AppBeans.get(Metadata.class).getSession();
assertNotNull(session);
Collection<MetaModel> models = session.getModels();
for (MetaModel model : models) {
System.out.println("Model: " + model.getName());
System.out.println(PrintUtils.printClassHierarchy(model));
}
}
use of com.haulmont.chile.core.model.Session in project cuba by cuba-platform.
the class EntityInspectorBrowse method init.
@Override
public void init(Map<String, Object> params) {
String entityName = (String) params.get("entity");
if (entityName != null) {
Session session = metadata.getSession();
selectedMeta = session.getClass(entityName);
createEntitiesTable(selectedMeta);
if (frame instanceof Lookup) {
setLookupComponent(entitiesTable);
}
lookupBox.setVisible(false);
} else {
entitiesLookup.setOptionsMap(getEntitiesLookupFieldOptions());
entitiesLookup.addValueChangeListener(e -> showEntities());
removedRecords.addValueChangeListener(e -> showEntities());
}
}
use of com.haulmont.chile.core.model.Session in project cuba by cuba-platform.
the class TestMetadataLoader method loadMetadata.
@Override
public void loadMetadata() {
initDatatypes(null);
MetaModelLoader modelLoader = createModelLoader(session);
for (Map.Entry<String, List<String>> entry : packages.entrySet()) {
List<EntityClassInfo> classInfos = entry.getValue().stream().map(name -> new EntityClassInfo(null, name, false)).collect(Collectors.toList());
modelLoader.loadModel(entry.getKey(), classInfos);
}
for (MetaClass metaClass : session.getClasses()) {
postProcessClass(metaClass);
initMetaAnnotations(metaClass);
}
}
Aggregations