Package it.eng.qbe.model.structure

Examples of it.eng.qbe.model.structure.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());
           
            //Add node for first level entities (using UniqueName)
            ModelViewEntity viewEntity = new ModelViewEntity(viewDescriptor, modelName, modelStructure, entity);
            propertiesInitializer.addProperties(viewEntity);
            entity.addSubEntity(viewEntity);
           
            //Add node for subentities (using Entity Type matching)
            for(IModelEntity modelEntity : allEntities){
              logger.debug("Searched Entity type: "+entity.getType());
              logger.debug("Current Entity type: "+modelEntity.getType());
              if (modelEntity.getType().equals(entity.getType())){
                ModelViewEntity viewEntitySub = new ModelViewEntity(viewDescriptor, modelName, modelStructure, modelEntity);
                propertiesInitializer.addProperties(viewEntitySub);
                logger.debug(" ** Found matching for: "+modelEntity.getType()+" with "+entity.getType());
                modelEntity.addSubEntity(viewEntitySub);
                addedViewsEntities.add(viewEntitySub);
              }
View Full Code Here


      }
    }
   
    // per il momento metto le join anche se non ce n'� bisogno
    for(String viewName : viewToInnerEntitiesMap.keySet()) {
      ModelViewEntity view = (ModelViewEntity)getDataSource().getModelStructure().getEntity( viewName );
      List<Join> joins = view.getJoins();
      for(Join join : joins) {
        IConditionalOperator conditionalOperator = null;
        conditionalOperator = (IConditionalOperator)JPQLStatementConditionalOperators.getOperator( CriteriaConstants.EQUALS_TO );
       
        String sourceEntityAlias = (String)entityAliases.get(join.getSourceEntity().getUniqueName());
View Full Code Here

TOP

Related Classes of it.eng.qbe.model.structure.ModelViewEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.