/// <summary>Initializes a new instance of the <see cref="DynamicRelation"/> class.</summary> /// <param name="leftOperand">The left operand, which is an entity.</param> /// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param> /// <param name="rightOperand">The right operand which is an entity.</param> /// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the left operand (only alias if you have to), specify string.Empty.</param> /// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param> /// <param name="onClause">The on clause for the join.</param> public DynamicRelation(policyDB.EntityType leftOperand, JoinHint joinType, policyDB.EntityType rightOperand, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause) { base.InitClass(joinType, aliasLeftOperand, aliasRightOperand, onClause, GeneralEntityFactory.Create(leftOperand), GeneralEntityFactory.Create(rightOperand)); }
/// <summary>Initializes a new instance of the <see cref="DynamicRelation"/> class.</summary> /// <param name="leftOperand">The left operand.</param> /// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param> /// <param name="rightOperand">The right operand which is an entity type.</param> /// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param> /// <param name="onClause">The on clause for the join.</param> public DynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, policyDB.EntityType rightOperand, string aliasRightOperand, IPredicate onClause) { base.InitClass(joinType, string.Empty, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand)); }
/// <summary>Creates a new, empty Entity object of the type specified</summary> /// <param name="entityTypeToCreate">The entity type to create.</param> /// <returns>A new, empty Entity object.</returns> public static IEntity Create(policyDB.EntityType entityTypeToCreate) { IEntityFactory factoryToUse = null; switch(entityTypeToCreate) { case policyDB.EntityType.AttributeEntity: factoryToUse = new AttributeEntityFactory(); break; case policyDB.EntityType.AttributeTypeEntity: factoryToUse = new AttributeTypeEntityFactory(); break; case policyDB.EntityType.AttributeValueEntity: factoryToUse = new AttributeValueEntityFactory(); break; case policyDB.EntityType.CombineModeEntity: factoryToUse = new CombineModeEntityFactory(); break; case policyDB.EntityType.ContextEntity: factoryToUse = new ContextEntityFactory(); break; case policyDB.EntityType.DecisionNodeEntity: factoryToUse = new DecisionNodeEntityFactory(); break; case policyDB.EntityType.EffectEntity: factoryToUse = new EffectEntityFactory(); break; case policyDB.EntityType.LibraryEntity: factoryToUse = new LibraryEntityFactory(); break; case policyDB.EntityType.PolicyEntity: factoryToUse = new PolicyEntityFactory(); break; case policyDB.EntityType.PolicyDocumentEntity: factoryToUse = new PolicyDocumentEntityFactory(); break; case policyDB.EntityType.PolicyLinkEntity: factoryToUse = new PolicyLinkEntityFactory(); break; case policyDB.EntityType.QueryEntity: factoryToUse = new QueryEntityFactory(); break; case policyDB.EntityType.QueryValueEntity: factoryToUse = new QueryValueEntityFactory(); break; case policyDB.EntityType.RuleEntity: factoryToUse = new RuleEntityFactory(); break; case policyDB.EntityType.TargetEntity: factoryToUse = new TargetEntityFactory(); break; case policyDB.EntityType.TargetConditionEntity: factoryToUse = new TargetConditionEntityFactory(); break; case policyDB.EntityType.UriComponentEntity: factoryToUse = new UriComponentEntityFactory(); break; } IEntity toReturn = null; if(factoryToUse != null) { toReturn = factoryToUse.Create(); } return toReturn; }
/// <summary>Creates a new entity collection</summary> /// <param name="typeToUse">The entity type to create the collection for.</param> /// <returns>A new entity collection object.</returns> public static IEntityCollection Create(policyDB.EntityType typeToUse) { switch(typeToUse) { case policyDB.EntityType.AttributeEntity: return new AttributeCollection(); case policyDB.EntityType.AttributeTypeEntity: return new AttributeTypeCollection(); case policyDB.EntityType.AttributeValueEntity: return new AttributeValueCollection(); case policyDB.EntityType.CombineModeEntity: return new CombineModeCollection(); case policyDB.EntityType.ContextEntity: return new ContextCollection(); case policyDB.EntityType.DecisionNodeEntity: return new DecisionNodeCollection(); case policyDB.EntityType.EffectEntity: return new EffectCollection(); case policyDB.EntityType.LibraryEntity: return new LibraryCollection(); case policyDB.EntityType.PolicyEntity: return new PolicyCollection(); case policyDB.EntityType.PolicyDocumentEntity: return new PolicyDocumentCollection(); case policyDB.EntityType.PolicyLinkEntity: return new PolicyLinkCollection(); case policyDB.EntityType.QueryEntity: return new QueryCollection(); case policyDB.EntityType.QueryValueEntity: return new QueryValueCollection(); case policyDB.EntityType.RuleEntity: return new RuleCollection(); case policyDB.EntityType.TargetEntity: return new TargetCollection(); case policyDB.EntityType.TargetConditionEntity: return new TargetConditionCollection(); case policyDB.EntityType.UriComponentEntity: return new UriComponentCollection(); default: return null; } }
/// <summary>Gets the factory of the entity with the policyDB.EntityType specified</summary> /// <param name="typeOfEntity">The type of entity.</param> /// <returns>factory to use or null if not found</returns> public static IEntityFactory GetFactory(policyDB.EntityType typeOfEntity) { return GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType()); }
/// <summary>CTor</summary> /// <param name="entityName">Name of the entity.</param> /// <param name="typeOfEntity">The type of entity.</param> public EntityFactoryBase(string entityName, policyDB.EntityType typeOfEntity) { _entityName = entityName; _typeOfEntity = typeOfEntity; }