/// <summary>Creates a new AttributeEntity instance and will set the Fields object of the new IEntity instance to the passed in fields object.</summary> /// <param name="fields">Populated IEntityFields object for the new IEntity to create</param> /// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns> public override IEntity Create(IEntityFields fields) { IEntity toReturn = Create(); toReturn.Fields = fields; // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAttributeUsingFields // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }
/// <summary> /// Retrieves in the calling CustomerViewRelatedCollection object all CustomerViewRelatedEntity objects /// which are related via a relation of type 'm:n' with the passed in ShipMethodEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="shipMethodInstance">ShipMethodEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingShipMethodCollectionViaSalesOrderHeader(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity shipMethodInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.CustomerViewRelatedEntity); RelationCollection relations = new RelationCollection(); relations.Add(CustomerViewRelatedEntity.Relations.SalesOrderHeaderEntityUsingCustomerID, "SalesOrderHeader_"); relations.Add(SalesOrderHeaderEntity.Relations.ShipMethodEntityUsingShipMethodID, "SalesOrderHeader_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(shipMethodInstance.Fields[(int)ShipMethodFieldIndex.ShipMethodID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary>Retrieves in the calling ClassRegistrationCollection object all ClassRegistrationEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="offeringInstance">OfferingEntity instance to use as a filter for the ClassRegistrationEntity objects to return</param> /// <param name="studentInstance">StudentEntity instance to use as a filter for the ClassRegistrationEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity offeringInstance, IEntity studentInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(KSI.EntityType.ClassRegistrationEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(offeringInstance, studentInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling DeepFryerCollection object all DeepFryerEntity objects /// which are related via a relation of type 'm:n' with the passed in WorkOrderServiceLocationEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="workOrderServiceLocationInstance">WorkOrderServiceLocationEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingWorkOrderServiceLocationCollectionViaDeepFryerService(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity workOrderServiceLocationInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Reliant.RenuOil.DAL.EntityType.DeepFryerEntity); RelationCollection relations = new RelationCollection(); relations.Add(DeepFryerEntity.Relations.DeepFryerServiceEntityUsingDeepFryerId, "DeepFryerService_"); relations.Add(DeepFryerServiceEntity.Relations.WorkOrderServiceLocationEntityUsingWorkOrderServiceLocationId, "DeepFryerService_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(workOrderServiceLocationInstance.Fields[(int)WorkOrderServiceLocationFieldIndex.WorkOrderServiceLocationId], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling DeepFryerCollection object all DeepFryerEntity objects /// which are related via a relation of type 'm:n' with the passed in ChangeLogEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="changeLogInstance">ChangeLogEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingChangeLogCollectionViaDeepFryerChangeLog(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity changeLogInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Reliant.RenuOil.DAL.EntityType.DeepFryerEntity); RelationCollection relations = new RelationCollection(); relations.Add(DeepFryerEntity.Relations.DeepFryerChangeLogEntityUsingDeepFryerId, "DeepFryerChangeLog_"); relations.Add(DeepFryerChangeLogEntity.Relations.ChangeLogEntityUsingChangeLogId, "DeepFryerChangeLog_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(changeLogInstance.Fields[(int)ChangeLogFieldIndex.ChangeLogId], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary>Retrieves in the calling ThreadCollection object all ThreadEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="forumInstance">ForumEntity instance to use as a filter for the ThreadEntity objects to return</param> /// <param name="userWhoStartedThreadInstance">UserEntity instance to use as a filter for the ThreadEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity forumInstance, IEntity userWhoStartedThreadInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(SD.HnD.DAL.EntityType.ThreadEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(forumInstance, userWhoStartedThreadInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling RebateTypeCollection object all RebateTypeEntity objects /// which are related via a relation of type 'm:n' with the passed in AccountEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="accountInstance">AccountEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingAccountCollectionViaRebate(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity accountInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Reliant.RenuOil.DAL.EntityType.RebateTypeEntity); RelationCollection relations = new RelationCollection(); relations.Add(RebateTypeEntity.Relations.RebateEntityUsingRebateTypeId, "Rebate_"); relations.Add(RebateEntity.Relations.AccountEntityUsingAccountId, "Rebate_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(accountInstance.Fields[(int)AccountFieldIndex.AccountId], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling SalesReasonCollection object all SalesReasonEntity objects /// which are related via a relation of type 'm:n' with the passed in SalesOrderHeaderEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="salesOrderHeaderInstance">SalesOrderHeaderEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingSalesOrderHeaderCollectionViaSalesOrderHeaderSalesReason(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity salesOrderHeaderInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.SalesReasonEntity); RelationCollection relations = new RelationCollection(); relations.Add(SalesReasonEntity.Relations.SalesOrderHeaderSalesReasonEntityUsingSalesReasonID, "SalesOrderHeaderSalesReason_"); relations.Add(SalesOrderHeaderSalesReasonEntity.Relations.SalesOrderHeaderEntityUsingSalesOrderID, "SalesOrderHeaderSalesReason_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(salesOrderHeaderInstance.Fields[(int)SalesOrderHeaderFieldIndex.SalesOrderID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary>Retrieves in the calling EmailTemplateCollection object all EmailTemplateEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="personInstance">PersonEntity instance to use as a filter for the EmailTemplateEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity personInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(SquawkTalk.Datalayer.EntityType.EmailTemplateEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(personInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling SalesOrderDetailCollection object all SalesOrderDetailEntity objects which have data in common /// with the specified related Entities. If one is omitted, that entity is not used as a filter. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. /// When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="salesOrderHeaderInstance">SalesOrderHeaderEntity instance to use as a filter for the SalesOrderDetailEntity objects to return</param> /// <param name="specialOfferProductInstance">SpecialOfferProductEntity instance to use as a filter for the SalesOrderDetailEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity salesOrderHeaderInstance, IEntity specialOfferProductInstance, int pageNumber, int pageSize) { base.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.SalesOrderDetailEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(salesOrderHeaderInstance, specialOfferProductInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling RecycleVendorServiceCollection object all RecycleVendorServiceEntity objects which have data in common /// with the specified related Entities. If one is omitted, that entity is not used as a filter. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. /// When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="accountInstance">AccountEntity instance to use as a filter for the RecycleVendorServiceEntity objects to return</param> /// <param name="recycleTypeInstance">RecycleTypeEntity instance to use as a filter for the RecycleVendorServiceEntity objects to return</param> /// <param name="recycleVendorInstance">RecycleVendorEntity instance to use as a filter for the RecycleVendorServiceEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity accountInstance, IEntity recycleTypeInstance, IEntity recycleVendorInstance, int pageNumber, int pageSize) { base.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Reliant.RenuOil.DAL.EntityType.RecycleVendorServiceEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(accountInstance, recycleTypeInstance, recycleVendorInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling DepartmentCollection object all DepartmentEntity objects /// which are related via a relation of type 'm:n' with the passed in EmployeeEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="employeeInstance">EmployeeEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingEmployeeCollectionViaEmployeeDepartmentHistory(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity employeeInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.DepartmentEntity); RelationCollection relations = new RelationCollection(); relations.Add(DepartmentEntity.Relations.EmployeeDepartmentHistoryEntityUsingDepartmentID, "EmployeeDepartmentHistory_"); relations.Add(EmployeeDepartmentHistoryEntity.Relations.EmployeeEntityUsingEmployeeID, "EmployeeDepartmentHistory_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(employeeInstance.Fields[(int)EmployeeFieldIndex.EmployeeID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling TargetCollection object all TargetEntity objects /// which are related via a relation of type 'm:n' with the passed in DecisionNodeEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="decisionNodeInstance">DecisionNodeEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingConditionCollectionViaTargetCondition(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity decisionNodeInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.TargetEntity); RelationCollection relations = new RelationCollection(); relations.Add(TargetEntity.Relations.TargetConditionEntityUsingTargetId, "TargetCondition_"); relations.Add(TargetConditionEntity.Relations.DecisionNodeEntityUsingConditionId, "TargetCondition_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(decisionNodeInstance.Fields[(int)DecisionNodeFieldIndex.Id], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling AddressTypeCollection object all AddressTypeEntity objects /// which are related via a relation of type 'm:n' with the passed in AddressEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="addressInstance">AddressEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingAddressCollectionViaVendorAddress(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity addressInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.AddressTypeEntity); RelationCollection relations = new RelationCollection(); relations.Add(AddressTypeEntity.Relations.VendorAddressEntityUsingAddressTypeID, "VendorAddress_"); relations.Add(VendorAddressEntity.Relations.AddressEntityUsingAddressID, "VendorAddress_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(addressInstance.Fields[(int)AddressFieldIndex.AddressID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling CountryRegionCollection object all CountryRegionEntity objects /// which are related via a relation of type 'm:n' with the passed in SalesTerritoryEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="salesTerritoryInstance">SalesTerritoryEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingSalesTerritoryCollectionViaStateProvince(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity salesTerritoryInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.CountryRegionEntity); RelationCollection relations = new RelationCollection(); relations.Add(CountryRegionEntity.Relations.StateProvinceEntityUsingCountryRegionCode, "StateProvince_"); relations.Add(StateProvinceEntity.Relations.SalesTerritoryEntityUsingTerritoryID, "StateProvince_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(salesTerritoryInstance.Fields[(int)SalesTerritoryFieldIndex.TerritoryID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary> /// Retrieves in the calling CountryRegionCollection object all CountryRegionEntity objects /// which are related via a relation of type 'm:n' with the passed in CurrencyEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="currencyInstance">CurrencyEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingCurrencyCollectionViaCountryRegionCurrency(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity currencyInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.CountryRegionEntity); RelationCollection relations = new RelationCollection(); relations.Add(CountryRegionEntity.Relations.CountryRegionCurrencyEntityUsingCountryRegionCode, "CountryRegionCurrency_"); relations.Add(CountryRegionCurrencyEntity.Relations.CurrencyEntityUsingCurrencyCode, "CountryRegionCurrency_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(currencyInstance.Fields[(int)CurrencyFieldIndex.CurrencyCode], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary>Retrieves in the calling ChannelCollection object all ChannelEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="campaignInstance">CampaignEntity instance to use as a filter for the ChannelEntity objects to return</param> /// <param name="channelTypeInstance">ChannelTypeEntity instance to use as a filter for the ChannelEntity objects to return</param> /// <param name="redemptionCodeInstance">RedemptionCodeEntity instance to use as a filter for the ChannelEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity campaignInstance, IEntity channelTypeInstance, IEntity redemptionCodeInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Mecca.CMT.DAL.EntityType.ChannelEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(campaignInstance, channelTypeInstance, redemptionCodeInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling AssetTypeCollection object all AssetTypeEntity objects /// which are related via a relation of type 'm:n' with the passed in ServiceLocationEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="serviceLocationInstance">ServiceLocationEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingServiceLocationCollectionViaServiceLocationAssetTypeId(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity serviceLocationInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Reliant.RenuOil.DAL.EntityType.AssetTypeEntity); RelationCollection relations = new RelationCollection(); relations.Add(AssetTypeEntity.Relations.ServiceLocationAssetTypeEntityUsingAssetTypeId, "ServiceLocationAssetType_"); relations.Add(ServiceLocationAssetTypeEntity.Relations.ServiceLocationEntityUsingServiceLocationId, "ServiceLocationAssetType_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(serviceLocationInstance.Fields[(int)ServiceLocationFieldIndex.ServiceLocationId], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary> /// Retrieves in the calling VendorCollection object all VendorEntity objects /// which are related via a relation of type 'm:n' with the passed in EmployeeEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="employeeInstance">EmployeeEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingEmployeeCollectionViaPurchaseOrderHeader(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity employeeInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.VendorEntity); RelationCollection relations = new RelationCollection(); relations.Add(VendorEntity.Relations.PurchaseOrderHeaderEntityUsingVendorID, "PurchaseOrderHeader_"); relations.Add(PurchaseOrderHeaderEntity.Relations.EmployeeEntityUsingEmployeeID, "PurchaseOrderHeader_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(employeeInstance.Fields[(int)EmployeeFieldIndex.EmployeeID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary> /// Retrieves in the calling EmployeeDepartmentHistoryCollection object all EmployeeDepartmentHistoryEntity objects which have data in common /// with the specified related Entities. If one is omitted, that entity is not used as a filter. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. /// When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="departmentInstance">DepartmentEntity instance to use as a filter for the EmployeeDepartmentHistoryEntity objects to return</param> /// <param name="employeeInstance">EmployeeEntity instance to use as a filter for the EmployeeDepartmentHistoryEntity objects to return</param> /// <param name="shiftInstance">ShiftEntity instance to use as a filter for the EmployeeDepartmentHistoryEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity departmentInstance, IEntity employeeInstance, IEntity shiftInstance, int pageNumber, int pageSize) { base.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.EmployeeDepartmentHistoryEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(departmentInstance, employeeInstance, shiftInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling PolicyCollection object all PolicyEntity objects which have data in common /// with the specified related Entities. If one is omitted, that entity is not used as a filter. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. /// When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="combineModeInstance">CombineModeEntity instance to use as a filter for the PolicyEntity objects to return</param> /// <param name="libraryInstance">LibraryEntity instance to use as a filter for the PolicyEntity objects to return</param> /// <param name="targetInstance">TargetEntity instance to use as a filter for the PolicyEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity combineModeInstance, IEntity libraryInstance, IEntity targetInstance, int pageNumber, int pageSize) { base.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.PolicyEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(combineModeInstance, libraryInstance, targetInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary>Retrieves in the calling PurchaseHistoryCollection object all PurchaseHistoryEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="deviceInstance">DeviceEntity instance to use as a filter for the PurchaseHistoryEntity objects to return</param> /// <param name="locationInstance">LocationEntity instance to use as a filter for the PurchaseHistoryEntity objects to return</param> /// <param name="userInstance">UserEntity instance to use as a filter for the PurchaseHistoryEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity deviceInstance, IEntity locationInstance, IEntity userInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(EPICCentralDL.EntityType.PurchaseHistoryEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(deviceInstance, locationInstance, userInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling PolicyCollection object all PolicyEntity objects /// which are related via a relation of type 'm:n' with the passed in PolicyLinkEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="policyLinkInstance">PolicyLinkEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingPolicyLinkCollectionViaPolicyLink(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity policyLinkInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.PolicyEntity); RelationCollection relations = new RelationCollection(); relations.Add(PolicyEntity.Relations.PolicyLinkEntityUsingPolicyId, "PolicyLink_"); relations.Add(PolicyLinkEntity.Relations.PolicyLinkEntityUsingParentId, "PolicyLink_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(policyLinkInstance.Fields[(int)PolicyLinkFieldIndex.Id], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary> /// Retrieves in the calling UnitMeasureCollection object all UnitMeasureEntity objects /// which are related via a relation of type 'm:n' with the passed in ProductSubcategoryEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="productSubcategoryInstance">ProductSubcategoryEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingProductSubcategoryCollectionViaProduct_(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity productSubcategoryInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.UnitMeasureEntity); RelationCollection relations = new RelationCollection(); relations.Add(UnitMeasureEntity.Relations.ProductEntityUsingWeightUnitMeasureCode, "Product_"); relations.Add(ProductEntity.Relations.ProductSubcategoryEntityUsingProductSubcategoryID, "Product_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(productSubcategoryInstance.Fields[(int)ProductSubcategoryFieldIndex.ProductSubcategoryID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary> /// Retrieves in the calling UnitMeasureCollection object all UnitMeasureEntity objects /// which are related via a relation of type 'm:n' with the passed in VendorEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="vendorInstance">VendorEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingVendorCollectionViaProductVendor(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity vendorInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.UnitMeasureEntity); RelationCollection relations = new RelationCollection(); relations.Add(UnitMeasureEntity.Relations.ProductVendorEntityUsingUnitMeasureCode, "ProductVendor_"); relations.Add(ProductVendorEntity.Relations.VendorEntityUsingVendorID, "ProductVendor_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(vendorInstance.Fields[(int)VendorFieldIndex.VendorID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling LocationCollection object all LocationEntity objects /// which are related via a relation of type 'm:n' with the passed in WorkOrderEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="workOrderInstance">WorkOrderEntity object to be used as a filter in the m:n relation</param> /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingWorkOrderCollectionViaWorkOrderRouting(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity workOrderInstance, IPrefetchPath prefetchPathToUse) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(AW.Data.EntityType.LocationEntity); RelationCollection relations = new RelationCollection(); relations.Add(LocationEntity.Relations.WorkOrderRoutingEntityUsingLocationID, "WorkOrderRouting_"); relations.Add(WorkOrderRoutingEntity.Relations.WorkOrderEntityUsingWorkOrderID, "WorkOrderRouting_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(workOrderInstance.Fields[(int)WorkOrderFieldIndex.WorkOrderID], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse)); }
/// <summary>Retrieves in the calling TerritoryCollection object all TerritoryEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="regionInstance">RegionEntity instance to use as a filter for the TerritoryEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity regionInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(SD.LLBLGen.Pro.Examples.Auditing.EntityType.TerritoryEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(regionInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary>Retrieves in the calling ProductCollection object all ProductEntity objects which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="categoryInstance">CategoryEntity instance to use as a filter for the ProductEntity objects to return</param> /// <param name="supplierInstance">SupplierEntity instance to use as a filter for the ProductEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity categoryInstance, IEntity supplierInstance, int pageNumber, int pageSize) { this.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Northwind.DAL.EntityType.ProductEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(categoryInstance, supplierInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(this.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling ControlSetColourCollection object all ControlSetColourEntity objects which have data in common /// with the specified related Entities. If one is omitted, that entity is not used as a filter. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. /// When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="controlSetInstance">ControlSetEntity instance to use as a filter for the ControlSetColourEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity controlSetInstance, int pageNumber, int pageSize) { base.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(silverspun.RGBDiff.Dal.EntityType.ControlSetColourEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(controlSetInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling PolicyCollection object all PolicyEntity objects /// which are related via a relation of type 'm:n' with the passed in EffectEntity. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="effectInstance">EffectEntity object to be used as a filter in the m:n relation</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiUsingEffectCollectionViaRule(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity effectInstance, int pageNumber, int pageSize) { IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.PolicyEntity); RelationCollection relations = new RelationCollection(); relations.Add(PolicyEntity.Relations.RuleEntityUsingPolicyId, "Rule_"); relations.Add(RuleEntity.Relations.EffectEntityUsingEffectId, "Rule_", string.Empty, JoinHint.None); IPredicateExpression selectFilter = new PredicateExpression(); selectFilter.Add(new FieldCompareValuePredicate(effectInstance.Fields[(int)EffectFieldIndex.Id], ComparisonOperator.Equal)); return(GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize)); }
/// <summary> /// Retrieves in the calling DeepFryerServiceChangeLogCollection object all DeepFryerServiceChangeLogEntity objects which have data in common /// with the specified related Entities. If one is omitted, that entity is not used as a filter. /// </summary> /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param> /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. /// When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param> /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param> /// <param name="filter">Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored.</param> /// <param name="deepFryerServiceInstance">DeepFryerServiceEntity instance to use as a filter for the DeepFryerServiceChangeLogEntity objects to return</param> /// <param name="employee_Instance">EmployeeEntity instance to use as a filter for the DeepFryerServiceChangeLogEntity objects to return</param> /// <param name="employeeInstance">EmployeeEntity instance to use as a filter for the DeepFryerServiceChangeLogEntity objects to return</param> /// <param name="serviceLocationInstance">ServiceLocationEntity instance to use as a filter for the DeepFryerServiceChangeLogEntity objects to return</param> /// <param name="userInstance">UserEntity instance to use as a filter for the DeepFryerServiceChangeLogEntity objects to return</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> public bool GetMulti(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IPredicateExpression filter, IEntity deepFryerServiceInstance, IEntity employee_Instance, IEntity employeeInstance, IEntity serviceLocationInstance, IEntity userInstance, int pageNumber, int pageSize) { base.EntityFactoryToUse = entityFactoryToUse; IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Reliant.RenuOil.DAL.EntityType.DeepFryerServiceChangeLogEntity); IPredicateExpression selectFilter = CreateFilterUsingForeignKeys(deepFryerServiceInstance, employee_Instance, employeeInstance, serviceLocationInstance, userInstance, fieldsToReturn); if (filter != null) { selectFilter.AddWithAnd(filter); } return(base.PerformGetMultiAction(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, null, null, null, pageNumber, pageSize)); }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="combineModeInstance">CombineModeEntity instance to use as a filter for the PolicyEntity objects</param> /// <param name="libraryInstance">LibraryEntity instance to use as a filter for the PolicyEntity objects</param> /// <param name="targetInstance">TargetEntity instance to use as a filter for the PolicyEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity combineModeInstance, IEntity libraryInstance, IEntity targetInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(combineModeInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)PolicyFieldIndex.CombineModeId], ComparisonOperator.Equal, ((CombineModeEntity)combineModeInstance).Id)); } if(libraryInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)PolicyFieldIndex.LibraryId], ComparisonOperator.Equal, ((LibraryEntity)libraryInstance).Id)); } if(targetInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)PolicyFieldIndex.TargetId], ComparisonOperator.Equal, ((TargetEntity)targetInstance).Id)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="sectionInstance">SectionEntity instance to use as a filter for the ForumEntity objects</param> /// <param name="defaultSupportQueueInstance">SupportQueueEntity instance to use as a filter for the ForumEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity sectionInstance, IEntity defaultSupportQueueInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(sectionInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ForumFieldIndex.SectionID], ComparisonOperator.Equal, ((SectionEntity)sectionInstance).SectionID)); } if(defaultSupportQueueInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ForumFieldIndex.DefaultSupportQueueID], ComparisonOperator.Equal, ((SupportQueueEntity)defaultSupportQueueInstance).QueueID)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="auctionEventInstance">AuctionEventEntity instance to use as a filter for the RaffleEntity objects</param> /// <param name="user_Instance">UserEntity instance to use as a filter for the RaffleEntity objects</param> /// <param name="userInstance">UserEntity instance to use as a filter for the RaffleEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity auctionEventInstance, IEntity user_Instance, IEntity userInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(auctionEventInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)RaffleFieldIndex.EventId], ComparisonOperator.Equal, ((AuctionEventEntity)auctionEventInstance).Id)); } if(user_Instance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)RaffleFieldIndex.UpdatedBy], ComparisonOperator.Equal, ((UserEntity)user_Instance).Id)); } if(userInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)RaffleFieldIndex.CreatedBy], ComparisonOperator.Equal, ((UserEntity)userInstance).Id)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="accountInstance">AccountEntity instance to use as a filter for the UserEntity objects</param> /// <param name="roleInstance">RoleEntity instance to use as a filter for the UserEntity objects</param> /// <param name="userInstance">UserEntity instance to use as a filter for the UserEntity objects</param> /// <param name="user__Instance">UserEntity instance to use as a filter for the UserEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity accountInstance, IEntity roleInstance, IEntity userInstance, IEntity user__Instance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(accountInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)UserFieldIndex.AccountId], ComparisonOperator.Equal, ((AccountEntity)accountInstance).Id)); } if(roleInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)UserFieldIndex.RoleId], ComparisonOperator.Equal, ((RoleEntity)roleInstance).Id)); } if(userInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)UserFieldIndex.CreatedBy], ComparisonOperator.Equal, ((UserEntity)userInstance).Id)); } if(user__Instance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)UserFieldIndex.UpdatedBy], ComparisonOperator.Equal, ((UserEntity)user__Instance).Id)); } return selectFilter; }
/// <summary> /// Fetches the values passed in into the fieldsToFill. /// </summary> /// <param name="rowValues">The row values.</param> /// <param name="fieldsToFill">The IEntityFields implementing object where the data should be stored.</param> internal static void ReadRowIntoFields(object[] rowValues, IEntityFields fieldsToFill) { // The pairs should be sorted by the ordinal of the column in the rowValues array. for (int i = 0; i < rowValues.Length; i++) { EntityField fieldToSet = (EntityField)fieldsToFill[i]; // Get the value object value = rowValues[i]; // test for NULL bool isColumnValueDBNull = (value == System.DBNull.Value); // Set the value fieldToSet.IsNull = isColumnValueDBNull; fieldToSet.ForceSetCurrentValue(value); } // Set the fields state to fetched fieldsToFill.State = EntityState.Fetched; // Set the fields not as dirty since they are freshly fetched fieldsToFill.IsDirty = false; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="supportQueueInstance">SupportQueueEntity instance to use as a filter for the SupportQueueThreadEntity objects</param> /// <param name="claimedByUserInstance">UserEntity instance to use as a filter for the SupportQueueThreadEntity objects</param> /// <param name="placedInQueueByUserInstance">UserEntity instance to use as a filter for the SupportQueueThreadEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity supportQueueInstance, IEntity claimedByUserInstance, IEntity placedInQueueByUserInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(supportQueueInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)SupportQueueThreadFieldIndex.QueueID], ComparisonOperator.Equal, ((SupportQueueEntity)supportQueueInstance).QueueID)); } if(claimedByUserInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)SupportQueueThreadFieldIndex.ClaimedByUserID], ComparisonOperator.Equal, ((UserEntity)claimedByUserInstance).UserID)); } if(placedInQueueByUserInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)SupportQueueThreadFieldIndex.PlacedInQueueByUserID], ComparisonOperator.Equal, ((UserEntity)placedInQueueByUserInstance).UserID)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="auctionEventInstance">AuctionEventEntity instance to use as a filter for the AuctionEventDonorEntity objects</param> /// <param name="donorInstance">DonorEntity instance to use as a filter for the AuctionEventDonorEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity auctionEventInstance, IEntity donorInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(auctionEventInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AuctionEventDonorFieldIndex.EventId], ComparisonOperator.Equal, ((AuctionEventEntity)auctionEventInstance).Id)); } if(donorInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AuctionEventDonorFieldIndex.DonorId], ComparisonOperator.Equal, ((DonorEntity)donorInstance).Id)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="roleInstance">RoleEntity instance to use as a filter for the RoleUserEntity objects</param> /// <param name="userInstance">UserEntity instance to use as a filter for the RoleUserEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity roleInstance, IEntity userInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(roleInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)RoleUserFieldIndex.RoleID], ComparisonOperator.Equal, ((RoleEntity)roleInstance).RoleID)); } if(userInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)RoleUserFieldIndex.UserID], ComparisonOperator.Equal, ((UserEntity)userInstance).UserID)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="forumInstance">ForumEntity instance to use as a filter for the ThreadEntity objects</param> /// <param name="userWhoStartedThreadInstance">UserEntity instance to use as a filter for the ThreadEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity forumInstance, IEntity userWhoStartedThreadInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(forumInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ThreadFieldIndex.ForumID], ComparisonOperator.Equal, ((ForumEntity)forumInstance).ForumID)); } if(userWhoStartedThreadInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ThreadFieldIndex.StartedByUserID], ComparisonOperator.Equal, ((UserEntity)userWhoStartedThreadInstance).UserID)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="threadInstance">ThreadEntity instance to use as a filter for the ThreadSubscriptionEntity objects</param> /// <param name="userInstance">UserEntity instance to use as a filter for the ThreadSubscriptionEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity threadInstance, IEntity userInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(threadInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ThreadSubscriptionFieldIndex.ThreadID], ComparisonOperator.Equal, ((ThreadEntity)threadInstance).ThreadID)); } if(userInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ThreadSubscriptionFieldIndex.UserID], ComparisonOperator.Equal, ((UserEntity)userInstance).UserID)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="brandInstance">BrandEntity instance to use as a filter for the ProductEntity objects</param> /// <param name="categoryInstance">CategoryEntity instance to use as a filter for the ProductEntity objects</param> /// <param name="storeInstance">StoreEntity instance to use as a filter for the ProductEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity brandInstance, IEntity categoryInstance, IEntity storeInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(brandInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ProductFieldIndex.BrandId], ComparisonOperator.Equal, ((BrandEntity)brandInstance).Id)); } if(categoryInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ProductFieldIndex.CategoryId], ComparisonOperator.Equal, ((CategoryEntity)categoryInstance).Id)); } if(storeInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ProductFieldIndex.StoreId], ComparisonOperator.Equal, ((StoreEntity)storeInstance).Id)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="attributeInstance">AttributeEntity instance to use as a filter for the AttributeValueEntity objects</param> /// <param name="attributeMatchInstance">DecisionNodeEntity instance to use as a filter for the AttributeValueEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity attributeInstance, IEntity attributeMatchInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(attributeInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AttributeValueFieldIndex.AttributeId], ComparisonOperator.Equal, ((AttributeEntity)attributeInstance).Id)); } if(attributeMatchInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AttributeValueFieldIndex.AttributeMatchId], ComparisonOperator.Equal, ((DecisionNodeEntity)attributeMatchInstance).Id)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="cityInstance">CityEntity instance to use as a filter for the StoreInformationEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity cityInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(cityInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)StoreInformationFieldIndex.CityId], ComparisonOperator.Equal, ((CityEntity)cityInstance).Id)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="accountInstance">AccountEntity instance to use as a filter for the CategoryEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity accountInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(accountInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)CategoryFieldIndex.AccountId], ComparisonOperator.Equal, ((AccountEntity)accountInstance).Id)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="membershipInstance">MembershipEntity instance to use as a filter for the StoreEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity membershipInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(membershipInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)StoreFieldIndex.MembershipId], ComparisonOperator.Equal, ((MembershipEntity)membershipInstance).Id)); } return selectFilter; }
/// <summary> /// Executes the passed in retrieval query and, if not null, runs it inside the active transaction. Used to read 1 row. /// It sets the connection object of the command object of query object passed in to the connection object of this class. /// </summary> /// <param name="command">The command to execute.</param> /// <param name="fieldsToFill">The IEntityFields object to store the fetched data in</param> public void ExecuteSingleRowRetrievalQuery(IDbCommand command, IEntityFields fieldsToFill) { IDataReader dataReader = null; try { this.PrepareCommandForExecution(command); this.OpenConnection(); try { dataReader = command.ExecuteReader(CommandBehavior.SingleRow); BaseDataProvider.FetchOneRow(dataReader, fieldsToFill); } catch (Exception ex) { throw new CommandExecutionException( String.Format("An exception was caught during the execution of a retrieval query: {0}. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.", ex.Message), command.CommandText, command.Parameters, ex); } finally { if (command != null) { command.Dispose(); } } } finally { if (dataReader != null) dataReader.Dispose(); this.CloseConnectionIfPossible(); } }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="auditActionInstance">AuditActionEntity instance to use as a filter for the AuditDataCoreEntity objects</param> /// <param name="userAuditedInstance">UserEntity instance to use as a filter for the AuditDataCoreEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity auditActionInstance, IEntity userAuditedInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(auditActionInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AuditDataCoreFieldIndex.AuditActionID], ComparisonOperator.Equal, ((AuditActionEntity)auditActionInstance).AuditActionID)); } if(userAuditedInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AuditDataCoreFieldIndex.UserID], ComparisonOperator.Equal, ((UserEntity)userAuditedInstance).UserID)); } return selectFilter; }
/// <summary> /// Fetches one row from the open data-reader and places that row into the passed in fields collection. /// </summary> /// <param name="dataReader">The open datareader used to fetch the data</param> /// <param name="fieldsToFill">The IEntityFields implementing object where the data should be stored.</param> private static void FetchOneRow(IDataReader dataReader, IEntityFields fieldsToFill) { if (dataReader == null) { return; } if (dataReader.IsClosed) { return; } if (fieldsToFill == null) { return; } // Read 1 row. First advance to first byte if (dataReader.Read()) { object[] rowValues = new object[dataReader.FieldCount]; try { dataReader.GetValues(rowValues); } catch (Exception e) { Trace.WriteLine("Exception caught in BaseSqlDataProvider.FetchOneRow: " + e.Message); throw; } // Now read the actual row values into the fields collection BaseDataProvider.ReadRowIntoFields(rowValues, fieldsToFill); } }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="decisionNodeInstance">DecisionNodeEntity instance to use as a filter for the TargetConditionEntity objects</param> /// <param name="targetInstance">TargetEntity instance to use as a filter for the TargetConditionEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity decisionNodeInstance, IEntity targetInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(decisionNodeInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)TargetConditionFieldIndex.ConditionId], ComparisonOperator.Equal, ((DecisionNodeEntity)decisionNodeInstance).Id)); } if(targetInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)TargetConditionFieldIndex.TargetId], ComparisonOperator.Equal, ((TargetEntity)targetInstance).Id)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="productInstance">ProductEntity instance to use as a filter for the CommentEntity objects</param> /// <param name="rateInstance">RateEntity instance to use as a filter for the CommentEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity productInstance, IEntity rateInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(productInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)CommentFieldIndex.ProductId], ComparisonOperator.Equal, ((ProductEntity)productInstance).Id)); } if(rateInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)CommentFieldIndex.RateId], ComparisonOperator.Equal, ((RateEntity)rateInstance).Id)); } return selectFilter; }
/// <summary> /// Retrieves rows in the datatable provided which match the specified filter, containing the fields specified. It will always create a new connection to the database. /// </summary> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the resultset to return.</param> /// <param name="tableToFill">The datatable to fill with the rows retrieved</param> /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. When set to 0, no limitations are specified.</param> /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When null is specified, no sorting is applied.</param> /// <param name="selectFilter">A predicate or predicate expression which should be used as filter for the entities to retrieve.</param> /// <param name="relations">The set of relations to walk to construct to total query.</param> /// <param name="allowDuplicates">Flag to allow duplicate rows or not</param> /// <param name="groupByClause">The list of fields to group by on. When not specified or an empty collection is specified, no group by clause /// is added to the query. A check is performed for each field in the selectList. If a field in the selectList is not present in the groupByClause collection, an exception is thrown.</param> /// <param name="transactionToUse">The transaction object to use. Can be null. If specified, the connection object of the transaction is used to fill the TypedView, which avoids deadlocks on SqlServer.</param> /// <param name="pageNumber">The page number to retrieve.</param> /// <param name="pageSize">The page size of the page to retrieve.</param> /// <returns>true if succeeded, false otherwise</returns> public bool GetMultiAsDataTable(IEntityFields fieldsToReturn, DataTable tableToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, bool allowDuplicates, IGroupByCollection groupByClause, ITransaction transactionToUse, int pageNumber, int pageSize) { return base.PerformGetMultiAsDataTableAction(fieldsToReturn, tableToFill, maxNumberOfItemsToReturn, sortClauses, selectFilter, relations, allowDuplicates, groupByClause, transactionToUse, pageNumber, pageSize); }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="roleInstance">RoleEntity instance to use as a filter for the MembershipEntity objects</param> /// <param name="storeInformationInstance">StoreInformationEntity instance to use as a filter for the MembershipEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity roleInstance, IEntity storeInformationInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(roleInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)MembershipFieldIndex.RoleId], ComparisonOperator.Equal, ((RoleEntity)roleInstance).Id)); } if(storeInformationInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)MembershipFieldIndex.StoreInformationId], ComparisonOperator.Equal, ((StoreInformationEntity)storeInformationInstance).Id)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="libraryInstance">LibraryEntity instance to use as a filter for the QueryEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity libraryInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(libraryInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)QueryFieldIndex.LibraryId], ComparisonOperator.Equal, ((LibraryEntity)libraryInstance).Id)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="mpicInstance">MPicEntity instance to use as a filter for the TJadwalEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity mpicInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(mpicInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)TJadwalFieldIndex.CPic], ComparisonOperator.Equal, ((MPicEntity)mpicInstance).CPic)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="malatInstance">MAlatEntity instance to use as a filter for the THistoryAlatEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity malatInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(malatInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)THistoryAlatFieldIndex.CIdAlat], ComparisonOperator.Equal, ((MAlatEntity)malatInstance).CIdAlat)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="actionRightInstance">ActionRightEntity instance to use as a filter for the ForumRoleForumActionRightEntity objects</param> /// <param name="forumInstance">ForumEntity instance to use as a filter for the ForumRoleForumActionRightEntity objects</param> /// <param name="roleInstance">RoleEntity instance to use as a filter for the ForumRoleForumActionRightEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity actionRightInstance, IEntity forumInstance, IEntity roleInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(actionRightInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ForumRoleForumActionRightFieldIndex.ActionRightID], ComparisonOperator.Equal, ((ActionRightEntity)actionRightInstance).ActionRightID)); } if(forumInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ForumRoleForumActionRightFieldIndex.ForumID], ComparisonOperator.Equal, ((ForumEntity)forumInstance).ForumID)); } if(roleInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)ForumRoleForumActionRightFieldIndex.RoleID], ComparisonOperator.Equal, ((RoleEntity)roleInstance).RoleID)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="muserInstance">MUserEntity instance to use as a filter for the MLokasiEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity muserInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(muserInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)MLokasiFieldIndex.CUserId], ComparisonOperator.Equal, ((MUserEntity)muserInstance).CUserId)); } return selectFilter; }
/// <summary> /// Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified. /// </summary> /// <param name="mhakAksesInstance">MHakAksesEntity instance to use as a filter for the MUserEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity mhakAksesInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(mhakAksesInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)MUserFieldIndex.CIdHakAkses], ComparisonOperator.Equal, ((MHakAksesEntity)mhakAksesInstance).CIdHakAkses)); } return selectFilter; }
/// <summary>Creates a PredicateExpression which should be used as a filter when any combination of available foreign keys is specified.</summary> /// <param name="belongsToMessageInstance">MessageEntity instance to use as a filter for the AttachmentEntity objects</param> /// <param name="fieldsToReturn">IEntityFields implementation which forms the definition of the fieldset of the target entity.</param> /// <returns>A ready to use PredicateExpression based on the passed in foreign key value holders.</returns> private IPredicateExpression CreateFilterUsingForeignKeys(IEntity belongsToMessageInstance, IEntityFields fieldsToReturn) { IPredicateExpression selectFilter = new PredicateExpression(); if(belongsToMessageInstance != null) { selectFilter.Add(new FieldCompareValuePredicate(fieldsToReturn[(int)AttachmentFieldIndex.MessageID], ComparisonOperator.Equal, ((MessageEntity)belongsToMessageInstance).MessageID)); } return selectFilter; }