/////////////////////////////////////////////////////////////// // This is generated code. ////////////////////////////////////////////////////////////// // Code is generated using LLBLGen Pro version: 2.0.0.0 // Code is generated on: Saturday, February 24, 2007 10:00:21 PM // Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20 // Templates vendor: Solutions Design. // Templates version: ////////////////////////////////////////////////////////////// using System; using System.Data; using System.Collections.Generic; using System.ComponentModel; using System.Xml; #if !CF using System.Runtime.Serialization; #endif using DataFeedFrameworkDAL.EntityClasses; using DataFeedFrameworkDAL.FactoryClasses; using DataFeedFrameworkDAL.DaoClasses; using DataFeedFrameworkDAL.HelperClasses; using SD.LLBLGen.Pro.ORMSupportClasses; namespace DataFeedFrameworkDAL.CollectionClasses { // __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces // __LLBLGENPRO_USER_CODE_REGION_END /// Collection class for storing and retrieving collections of SnippetEntity objects. #if CF [SD.LLBLGen.Pro.ORMSupportClasses.Serializable] #else [Serializable] #endif public partial class SnippetCollection : EntityCollectionBase { /// CTor public SnippetCollection():base(new SnippetEntityFactory()) { } /// CTor /// The initial contents of this collection. public SnippetCollection(IList initialContents):base(new SnippetEntityFactory()) { } /// CTor /// The EntityFactory to use when creating entity objects during a GetMulti() call. public SnippetCollection(IEntityFactory entityFactoryToUse):base(entityFactoryToUse) { } /// Private CTor for deserialization /// /// protected SnippetCollection(SerializationInfo info, StreamingContext context) : base(info, context) { } /// Retrieves in this SnippetCollection object all SnippetEntity 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. /// SnippetGroupEntity instance to use as a filter for the SnippetEntity objects to return /// true if succeeded, false otherwise public bool GetMultiManyToOne(IEntity snippetGroupInstance) { return GetMultiManyToOne(snippetGroupInstance, base.MaxNumberOfItemsToReturn, base.SortClauses, null, 0, 0); } /// Retrieves in this SnippetCollection object all SnippetEntity 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. /// SnippetGroupEntity instance to use as a filter for the SnippetEntity objects to return /// Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored. /// true if succeeded, false otherwise public bool GetMultiManyToOne(IEntity snippetGroupInstance, IPredicateExpression filter) { return GetMultiManyToOne(snippetGroupInstance, base.MaxNumberOfItemsToReturn, base.SortClauses, filter, 0, 0); } /// Retrieves in this SnippetCollection object all SnippetEntity 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. /// SnippetGroupEntity instance to use as a filter for the SnippetEntity objects to return /// The maximum number of items to return with this retrieval query. /// The order by specifications for the sorting of the resultset. When not specified, no sorting is applied. /// Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored. /// true if succeeded, false otherwise public bool GetMultiManyToOne(IEntity snippetGroupInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicateExpression filter) { return GetMultiManyToOne(snippetGroupInstance, maxNumberOfItemsToReturn, sortClauses, filter, 0, 0); } /// Retrieves in this SnippetCollection object all SnippetEntity 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. /// SnippetGroupEntity instance to use as a filter for the SnippetEntity objects to return /// The maximum number of items to return with this retrieval query. /// The order by specifications for the sorting of the resultset. When not specified, no sorting is applied. /// Extra filter to limit the resultset. Predicate expression can be null, in which case it will be ignored. /// The page number to retrieve. /// The page size of the page to retrieve. /// true if succeeded, false otherwise public virtual bool GetMultiManyToOne(IEntity snippetGroupInstance, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicateExpression filter, int pageNumber, int pageSize) { bool validParameters = false; validParameters |= (snippetGroupInstance!=null); if(!validParameters) { return GetMulti(filter, maxNumberOfItemsToReturn, sortClauses, null, pageNumber, pageSize); } if(!base.SuppressClearInGetMulti) { this.Clear(); } SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.GetMulti(base.Transaction, this, maxNumberOfItemsToReturn, sortClauses, base.EntityFactoryToUse, filter, snippetGroupInstance, pageNumber, pageSize); } /// Deletes from the persistent storage all Snippet entities which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. /// Runs directly on the persistent storage. It will not delete entity objects from the current collection. /// SnippetGroupEntity instance to use as a filter for the SnippetEntity objects to return /// Amount of entities affected, if the used persistent storage has rowcounting enabled. public int DeleteMultiManyToOne(IEntity snippetGroupInstance) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.DeleteMulti(base.Transaction, snippetGroupInstance); } /// Updates in the persistent storage all Snippet entities which have data in common with the specified related Entities. If one is omitted, that entity is not used as a filter. /// Which fields are updated in those matching entities depends on which fields are changed in the passed in entity entityWithNewValues. The new values of these fields are read from entityWithNewValues. /// SnippetEntity instance which holds the new values for the matching entities to update. Only changed fields are taken into account /// SnippetGroupEntity instance to use as a filter for the SnippetEntity objects to return /// Amount of entities affected, if the used persistent storage has rowcounting enabled. public int UpdateMultiManyToOne(SnippetEntity entityWithNewValues, IEntity snippetGroupInstance) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.UpdateMulti(entityWithNewValues, base.Transaction, snippetGroupInstance); } /// Retrieves Entity rows in a datatable which match the specified filter. It will always create a new connection to the database. /// A predicate or predicate expression which should be used as filter for the entities to retrieve. /// The maximum number of items to return with this retrieval query. /// The order by specifications for the sorting of the resultset. When not specified, no sorting is applied. /// DataTable with the rows requested. public static DataTable GetMultiAsDataTable(IPredicate selectFilter, long maxNumberOfItemsToReturn, ISortExpression sortClauses) { return GetMultiAsDataTable(selectFilter, maxNumberOfItemsToReturn, sortClauses, null, 0, 0); } /// Retrieves Entity rows in a datatable which match the specified filter. It will always create a new connection to the database. /// A predicate or predicate expression which should be used as filter for the entities to retrieve. /// The maximum number of items to return with this retrieval query. /// The order by specifications for the sorting of the resultset. When not specified, no sorting is applied. /// The set of relations to walk to construct to total query. /// DataTable with the rows requested. public static DataTable GetMultiAsDataTable(IPredicate selectFilter, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations) { return GetMultiAsDataTable(selectFilter, maxNumberOfItemsToReturn, sortClauses, relations, 0, 0); } /// Retrieves Entity rows in a datatable which match the specified filter. It will always create a new connection to the database. /// A predicate or predicate expression which should be used as filter for the entities to retrieve. /// The maximum number of items to return with this retrieval query. /// The order by specifications for the sorting of the resultset. When not specified, no sorting is applied. /// The set of relations to walk to construct to total query. /// The page number to retrieve. /// The page size of the page to retrieve. /// DataTable with the rows requested. public static DataTable GetMultiAsDataTable(IPredicate selectFilter, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, int pageNumber, int pageSize) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.GetMultiAsDataTable(maxNumberOfItemsToReturn, sortClauses, selectFilter, relations, pageNumber, pageSize); } /// Deletes from the persistent storage all Snippet entities which match with the specified filter, formulated in the predicate or predicate expression definition. /// A predicate or predicate expression which should be used as filter for the entities to delete. Can be null, which will result in a query removing all Snippet entities from the persistent storage /// Amount of entities affected, if the used persistent storage has rowcounting enabled. public virtual int DeleteMulti(IPredicate deleteFilter) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.DeleteMulti(base.Transaction, deleteFilter); } /// Deletes from the persistent storage all Snippet entities which match with the specified filter, formulated in the predicate or predicate expression definition. /// A predicate or predicate expression which should be used as filter for the entities to delete. /// The set of relations to walk to construct the total query. /// Amount of entities affected, if the used persistent storage has rowcounting enabled. public virtual int DeleteMulti(IPredicate deleteFilter, IRelationCollection relations) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.DeleteMulti(base.Transaction, deleteFilter, relations); } /// Updates in the persistent storage all entities which have data in common with the specified SnippetEntity. If one is omitted that entity is not used as a filter. Which fields are updated in those matching entities depends on which fields are /// changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues. /// SnippetEntity instance which holds the new values for the matching entities to update. Only changed fields are taken into account /// A predicate or predicate expression which should be used as filter for the entities to update. Can be null, which /// will result in an update action which will affect all Snippet entities. /// Amount of entities affected, if the used persistent storage has rowcounting enabled. public int UpdateMulti(SnippetEntity entityWithNewValues, IPredicate updateFilter) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.UpdateMulti(entityWithNewValues, base.Transaction, updateFilter); } /// Updates in the persistent storage all entities which have data in common with the specified SnippetEntity. If one is omitted that entity is not used as a filter. Which fields are updated in those matching entities depends on which fields are /// changed in entityWithNewValues. The new values of these fields are read from entityWithNewValues. /// SnippetEntity instance which holds the new values for the matching entities to update. Only changed fields are taken into account /// A predicate or predicate expression which should be used as filter for the entities to update. /// The set of relations to walk to construct the total query. /// Amount of entities affected, if the used persistent storage has rowcounting enabled. public int UpdateMulti(SnippetEntity entityWithNewValues, IPredicate updateFilter, IRelationCollection relations) { SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.UpdateMulti(entityWithNewValues, base.Transaction, updateFilter, relations); } /// Gets a scalar value, calculated with the aggregate. the field index specified is the field the aggregate are applied on. /// Field index of field to which to apply the aggregate function and expression /// Aggregate function to apply. /// the scalar value requested public object GetScalar(SnippetFieldIndex fieldIndex, AggregateFunction aggregateToApply) { return GetScalar(fieldIndex, null, aggregateToApply, null, null, null); } /// Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on. /// Field index of field to which to apply the aggregate function and expression /// The expression to execute. Can be null /// Aggregate function to apply. /// the scalar value requested public object GetScalar(SnippetFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply) { return GetScalar(fieldIndex, expressionToExecute, aggregateToApply, null, null, null); } /// Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are /// applied on. /// Field index of field to which to apply the aggregate function and expression /// The expression to execute. Can be null /// Aggregate function to apply. /// The filter to apply to retrieve the scalar /// the scalar value requested public object GetScalar(SnippetFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter) { return GetScalar(fieldIndex, expressionToExecute, aggregateToApply, filter, null, null); } /// Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on. /// Field index of field to which to apply the aggregate function and expression /// The expression to execute. Can be null /// Aggregate function to apply. /// The filter to apply to retrieve the scalar /// The groupby clause to apply to retrieve the scalar /// the scalar value requested public object GetScalar(SnippetFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IGroupByCollection groupByClause) { return GetScalar(fieldIndex, expressionToExecute, aggregateToApply, filter, null, groupByClause); } /// Gets a scalar value, calculated with the aggregate and expression specified. the field index specified is the field the expression and aggregate are applied on. /// Field index of field to which to apply the aggregate function and expression /// The expression to execute. Can be null /// Aggregate function to apply. /// The filter to apply to retrieve the scalar /// The relations to walk /// The groupby clause to apply to retrieve the scalar /// the scalar value requested public virtual object GetScalar(SnippetFieldIndex fieldIndex, IExpression expressionToExecute, AggregateFunction aggregateToApply, IPredicate filter, IRelationCollection relations, IGroupByCollection groupByClause) { EntityFields fields = new EntityFields(1); fields[0] = EntityFieldFactory.Create(fieldIndex); if((fields[0].ExpressionToApply == null) || (expressionToExecute != null)) { fields[0].ExpressionToApply = expressionToExecute; } if((fields[0].AggregateFunctionToApply == AggregateFunction.None) || (aggregateToApply != AggregateFunction.None)) { fields[0].AggregateFunctionToApply = aggregateToApply; } SnippetDAO dao = DAOFactory.CreateSnippetDAO(); return dao.GetScalar(fields, base.Transaction, filter, relations, groupByClause); } /// Creats a new DAO instance so code which is in the base class can still use the proper DAO object. protected override IDao CreateDAOInstance() { return DAOFactory.CreateSnippetDAO(); } /// Creates a new transaction object /// The level of isolation. /// The name. protected override ITransaction CreateTransaction( IsolationLevel levelOfIsolation, string name ) { return new Transaction(levelOfIsolation, name); } #region Custom EntityCollection code // __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCollectionCode // __LLBLGENPRO_USER_CODE_REGION_END #endregion #region Included Code #endregion } }