/////////////////////////////////////////////////////////////// // 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:22 PM // Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20 // Templates vendor: Solutions Design. // Templates version: ////////////////////////////////////////////////////////////// using System; using System.Collections.Generic; using DataFeedFrameworkDAL.EntityClasses; using DataFeedFrameworkDAL.HelperClasses; using DataFeedFrameworkDAL.CollectionClasses; using SD.LLBLGen.Pro.ORMSupportClasses; namespace DataFeedFrameworkDAL.FactoryClasses { // __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces // __LLBLGENPRO_USER_CODE_REGION_END /// Factory to create new, empty FeedCreationEntity objects. #if CF [SD.LLBLGen.Pro.ORMSupportClasses.Serializable] #else [Serializable] #endif public partial class FeedCreationEntityFactory : IEntityFactory { /// Creates a new, empty FeedCreationEntity object. /// A new, empty FeedCreationEntity object. public virtual IEntity Create() { IEntity toReturn = new FeedCreationEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewFeedCreation // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; } /// Creates a new FeedCreationEntity instance but uses a special constructor which will set the Fields object of the new IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance. /// Populated IEntityFields object for the new IEntity to create /// Fully created and populated (due to the IEntityFields object) IEntity object public virtual IEntity Create(IEntityFields fields) { IEntity toReturn = Create(); toReturn.Fields = fields; // __LLBLGENPRO_USER_CODE_REGION_START CreateNewFeedCreationUsingFields // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; } /// Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. /// /// Empty IEntityFields object. public virtual IEntityFields CreateFields() { return EntityFieldsFactory.CreateEntityFieldsObject(DataFeedFrameworkDAL.EntityType.FeedCreationEntity); } /// Creates the hierarchy fields for the entity to which this factory belongs. /// IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy. public virtual IEntityFields CreateHierarchyFields() { return this.CreateFields(); } /// Creates the relations collection to the entity to join all targets so this entity can be fetched. /// null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself public virtual IRelationCollection CreateHierarchyRelations() { return null; } /// This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in. /// Field values read from the db, to determine which factory to return, based on the field values passed in. /// indexes into values where per entity type their own fields start. /// the factory for the entity which is represented by the values passed in. public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Dictionary entityFieldStartIndexesPerEntity) { return this; } /// Creates a new entity collection for the entity of this factory. /// ready to use new entity collection, typed. public virtual IEntityCollection CreateEntityCollection() { return new FeedCreationCollection(); } /// returns the name of the entity this factory is for, e.g. "EmployeeEntity" public virtual string ForEntityName { get { return "FeedCreationEntity"; } } #region Included Code #endregion } /// Factory to create new, empty SnippetEntity objects. #if CF [SD.LLBLGen.Pro.ORMSupportClasses.Serializable] #else [Serializable] #endif public partial class SnippetEntityFactory : IEntityFactory { /// Creates a new, empty SnippetEntity object. /// A new, empty SnippetEntity object. public virtual IEntity Create() { IEntity toReturn = new SnippetEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewSnippet // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; } /// Creates a new SnippetEntity instance but uses a special constructor which will set the Fields object of the new IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance. /// Populated IEntityFields object for the new IEntity to create /// Fully created and populated (due to the IEntityFields object) IEntity object public virtual IEntity Create(IEntityFields fields) { IEntity toReturn = Create(); toReturn.Fields = fields; // __LLBLGENPRO_USER_CODE_REGION_START CreateNewSnippetUsingFields // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; } /// Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. /// /// Empty IEntityFields object. public virtual IEntityFields CreateFields() { return EntityFieldsFactory.CreateEntityFieldsObject(DataFeedFrameworkDAL.EntityType.SnippetEntity); } /// Creates the hierarchy fields for the entity to which this factory belongs. /// IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy. public virtual IEntityFields CreateHierarchyFields() { return this.CreateFields(); } /// Creates the relations collection to the entity to join all targets so this entity can be fetched. /// null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself public virtual IRelationCollection CreateHierarchyRelations() { return null; } /// This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in. /// Field values read from the db, to determine which factory to return, based on the field values passed in. /// indexes into values where per entity type their own fields start. /// the factory for the entity which is represented by the values passed in. public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Dictionary entityFieldStartIndexesPerEntity) { return this; } /// Creates a new entity collection for the entity of this factory. /// ready to use new entity collection, typed. public virtual IEntityCollection CreateEntityCollection() { return new SnippetCollection(); } /// returns the name of the entity this factory is for, e.g. "EmployeeEntity" public virtual string ForEntityName { get { return "SnippetEntity"; } } #region Included Code #endregion } /// Factory to create new, empty SnippetGroupEntity objects. #if CF [SD.LLBLGen.Pro.ORMSupportClasses.Serializable] #else [Serializable] #endif public partial class SnippetGroupEntityFactory : IEntityFactory { /// Creates a new, empty SnippetGroupEntity object. /// A new, empty SnippetGroupEntity object. public virtual IEntity Create() { IEntity toReturn = new SnippetGroupEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewSnippetGroup // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; } /// Creates a new SnippetGroupEntity instance but uses a special constructor which will set the Fields object of the new IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance. /// Populated IEntityFields object for the new IEntity to create /// Fully created and populated (due to the IEntityFields object) IEntity object public virtual IEntity Create(IEntityFields fields) { IEntity toReturn = Create(); toReturn.Fields = fields; // __LLBLGENPRO_USER_CODE_REGION_START CreateNewSnippetGroupUsingFields // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; } /// Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. /// /// Empty IEntityFields object. public virtual IEntityFields CreateFields() { return EntityFieldsFactory.CreateEntityFieldsObject(DataFeedFrameworkDAL.EntityType.SnippetGroupEntity); } /// Creates the hierarchy fields for the entity to which this factory belongs. /// IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy. public virtual IEntityFields CreateHierarchyFields() { return this.CreateFields(); } /// Creates the relations collection to the entity to join all targets so this entity can be fetched. /// null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself public virtual IRelationCollection CreateHierarchyRelations() { return null; } /// This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in. /// Field values read from the db, to determine which factory to return, based on the field values passed in. /// indexes into values where per entity type their own fields start. /// the factory for the entity which is represented by the values passed in. public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Dictionary entityFieldStartIndexesPerEntity) { return this; } /// Creates a new entity collection for the entity of this factory. /// ready to use new entity collection, typed. public virtual IEntityCollection CreateEntityCollection() { return new SnippetGroupCollection(); } /// returns the name of the entity this factory is for, e.g. "EmployeeEntity" public virtual string ForEntityName { get { return "SnippetGroupEntity"; } } #region Included Code #endregion } /// Factory to create new, empty Entity objects based on the entity type specified. Uses entity specific factory objects /// #if CF [SD.LLBLGen.Pro.ORMSupportClasses.Serializable] #else [Serializable] #endif public partial class GeneralEntityFactory { /// Creates a new, empty Entity object of the type specified /// The entity type to create. /// A new, empty Entity object. public static IEntity Create(EntityType entityTypeToCreate) { IEntityFactory factoryToUse = null; switch(entityTypeToCreate) { case DataFeedFrameworkDAL.EntityType.FeedCreationEntity: factoryToUse = new FeedCreationEntityFactory(); break; case DataFeedFrameworkDAL.EntityType.SnippetEntity: factoryToUse = new SnippetEntityFactory(); break; case DataFeedFrameworkDAL.EntityType.SnippetGroupEntity: factoryToUse = new SnippetGroupEntityFactory(); break; } return factoryToUse.Create(); } } }