Exemplo n.º 1
0
        /// <summary> Retrieves in this AttributeCollection object all AttributeEntity objects which have data in common with the specified related Entities.
        /// If one is omitted, that entity is not used as a filter. All current elements in the collection are removed from the collection.</summary>
        /// <param name="attributeTypeInstance">AttributeTypeEntity instance to use as a filter for the AttributeEntity objects to return</param>
        /// <param name="contextInstance">ContextEntity instance to use as a filter for the AttributeEntity objects to return</param>
        /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query.</param>
        /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</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="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 virtual bool GetMultiManyToOne(IEntity attributeTypeInstance, IEntity contextInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicateExpression filter, int pageNumber, int pageSize)
        {
            bool validParameters = false;

            validParameters |= (attributeTypeInstance != null);
            validParameters |= (contextInstance != null);
            if (!validParameters)
            {
                return(GetMulti(filter, maxNumberOfItemsToReturn, sortClauses, null, pageNumber, pageSize));
            }
            if (!base.SuppressClearInGetMulti)
            {
                this.Clear();
            }
            AttributeDAO dao = DAOFactory.CreateAttributeDAO();

            return(dao.GetMulti(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, filter, attributeTypeInstance, contextInstance, pageNumber, pageSize));
        }