*/
List<ModelViewEntity> addedViewsEntities = new ArrayList<ModelViewEntity>();
List<IModelViewEntityDescriptor> list = getDataSource().getConfiguration().loadViews();
if(list.size() > 0) {
for (int i=0; i<list.size(); i++){
IModelViewEntityDescriptor viewDescriptor = list.get(i);
ModelViewEntity viewEntity = new ModelViewEntity(viewDescriptor, modelName, modelStructure, null);
addedViewsEntities.add(viewEntity);
propertiesInitializer.addProperties(viewEntity);
modelStructure.addRootEntity(modelName, viewEntity);
}
}
/*
* 2) Re-scan model structure to add nodes referencing view (inbound relations to Business Views)
*/
//visit all entities
List<IModelEntity> allEntities = visitModelStructure(modelStructure,modelName);
for (int i=0; i<list.size(); i++){
IModelViewEntityDescriptor viewDescriptor = list.get(i);
List<IModelViewRelationshipDescriptor> viewRelationshipsDescriptors = viewDescriptor.getRelationshipDescriptors();
for (IModelViewRelationshipDescriptor viewRelationshipDescriptor : viewRelationshipsDescriptors){
if (!viewRelationshipDescriptor.isOutbound()){
String sourceEntityUniqueName = viewRelationshipDescriptor.getSourceEntityUniqueName();
IModelEntity entity = modelStructure.getEntity(sourceEntityUniqueName);
logger.debug("Source Entity Unique name: "+entity.getUniqueName());