private ViewConfigurationModel fetchAssocDefViewConfig(Association assocDef) { try { // Note: othersTopicTypeUri=null, the view config's topic type is unknown (it is // client-specific) ResultSet<RelatedTopic> configTopics = assocDef.getRelatedTopics( "dm4.core.aggregation", "dm4.core.assoc_def", "dm4.core.view_config", null, true, false, 0, null); return new ViewConfigurationModel(DeepaMehtaUtils.toTopicModels(configTopics.getItems())); } catch (Exception e) { throw new RuntimeException( "Fetching view configuration for association definition " + assocDef.getId() + " failed", e); } }
private AssociationDefinitionModel fetchAssociationDefinition( Association assoc, String wholeTypeUri, String partTypeUri) { try { long assocId = assoc.getId(); return new AssociationDefinitionModel( assocId, assoc.getTypeUri(), wholeTypeUri, partTypeUri, fetchWholeCardinality(assocId).getUri(), fetchPartCardinality(assocId).getUri(), fetchAssocDefViewConfig(assoc)); } catch (Exception e) { throw new RuntimeException( "Fetching association definition failed (wholeTypeUri=\"" + wholeTypeUri + "\", partTypeUri=" + partTypeUri + ", " + assoc + ")", e); } }