///////////////////////////////////////////////////////////////
// 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.ComponentModel;
using System.Collections.Generic;
#if !CF
using System.Runtime.Serialization;
#endif
using System.Data;
using System.Xml.Serialization;
using DataFeedFrameworkDAL;
using DataFeedFrameworkDAL.FactoryClasses;
using DataFeedFrameworkDAL.DaoClasses;
using DataFeedFrameworkDAL.RelationClasses;
using DataFeedFrameworkDAL.HelperClasses;
using DataFeedFrameworkDAL.CollectionClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace DataFeedFrameworkDAL.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// Entity base class which represents the base class for the entity 'Snippet'.
///
///
#if CF
[SD.LLBLGen.Pro.ORMSupportClasses.Serializable]
#else
[Serializable]
#endif
public abstract partial class SnippetEntityBase : EntityBase, ISerializable
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
#region Class Member Declarations
private SnippetGroupEntity _snippetGroup;
private bool _alwaysFetchSnippetGroup, _alreadyFetchedSnippetGroup, _snippetGroupReturnsNewIfNotFound;
private static Dictionary _customProperties;
private static Dictionary> _fieldsCustomProperties;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
/// Static CTor for setting up custom property hashtables. Is executed before the first instance of this entity class or derived classes is constructed.
static SnippetEntityBase()
{
SetupCustomPropertyHashtables();
}
/// CTor
public SnippetEntityBase()
{
InitClassEmpty(CreateValidator());
}
/// CTor
/// PK value for Snippet which data should be fetched into this Snippet object
public SnippetEntityBase(System.Int32 snippetId)
{
InitClassFetch(snippetId, CreateValidator(), null);
}
/// CTor
/// PK value for Snippet which data should be fetched into this Snippet object
/// the PrefetchPath which defines the graph of objects to fetch as well
public SnippetEntityBase(System.Int32 snippetId, IPrefetchPath prefetchPathToUse)
{
InitClassFetch(snippetId, CreateValidator(), prefetchPathToUse);
}
/// CTor
/// PK value for Snippet which data should be fetched into this Snippet object
/// The custom validator object for this SnippetEntity
public SnippetEntityBase(System.Int32 snippetId, IValidator validator)
{
InitClassFetch(snippetId, validator, null);
}
/// Protected CTor for deserialization
///
///
protected SnippetEntityBase(SerializationInfo info, StreamingContext context) : base(info, context)
{
_snippetGroup = (SnippetGroupEntity)info.GetValue("_snippetGroup", typeof(SnippetGroupEntity));
if(_snippetGroup!=null)
{
_snippetGroup.AfterSave+=new EventHandler(OnEntityAfterSave);
}
_snippetGroupReturnsNewIfNotFound = info.GetBoolean("_snippetGroupReturnsNewIfNotFound");
_alwaysFetchSnippetGroup = info.GetBoolean("_alwaysFetchSnippetGroup");
_alreadyFetchedSnippetGroup = info.GetBoolean("_alreadyFetchedSnippetGroup");
base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance());
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// Will perform post-ReadXml actions
protected override void PostReadXmlFixups()
{
_alreadyFetchedSnippetGroup = (_snippetGroup != null);
}
/// Saves the Entity class to the persistent storage. It updates or inserts the entity, which depends if the entity was originally read from the
/// database. If the entity is new, an insert is done and the updateRestriction is ignored. If the entity is not new, the updateRestriction
/// predicate is used to create an additional where clause (it will be added with AND) for the update query. This predicate can be used for
/// concurrency checks, like checks on timestamp column values.
/// Predicate expression, meant for concurrency checks in an Update query. Will be ignored when the entity is new
/// When true, it will save all dirty objects referenced (directly or indirectly) by this entity also.
/// true if Save succeeded, false otherwise
/// When an exception is caught during the save process. The caught exception is set as the
/// inner exception. Encapsulation of database-related exceptions is necessary since these exceptions do not have a common exception framework implemented.
public override bool Save(IPredicate updateRestriction, bool recurse)
{
bool transactionStartedInThisScope = false;
Transaction transactionManager = null;
if(recurse || ((this.LLBLGenProIsInHierarchyOfType==InheritanceHierarchyType.TargetPerEntity) && this.LLBLGenProIsSubType))
{
if(!base.ParticipatesInTransaction)
{
transactionManager = new Transaction(IsolationLevel.ReadCommitted, "SaveRecursively");
transactionManager.Add(this);
transactionStartedInThisScope=true;
}
}
try
{
bool result = base.Save(updateRestriction, recurse);
if(transactionStartedInThisScope)
{
transactionManager.Commit();
}
return result;
}
catch
{
if(transactionStartedInThisScope)
{
transactionManager.Rollback();
}
throw;
}
finally
{
if(transactionStartedInThisScope)
{
transactionManager.Dispose();
}
}
}
/// ISerializable member. Does custom serialization so event handlers do not get serialized.
/// Serializes members of this entity class and uses the base class' implementation to serialize the rest.
///
///
[EditorBrowsable(EditorBrowsableState.Never)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("_snippetGroup", _snippetGroup);
info.AddValue("_snippetGroupReturnsNewIfNotFound", _snippetGroupReturnsNewIfNotFound);
info.AddValue("_alwaysFetchSnippetGroup", _alwaysFetchSnippetGroup);
info.AddValue("_alreadyFetchedSnippetGroup", _alreadyFetchedSnippetGroup);
// __LLBLGENPRO_USER_CODE_REGION_START GetObjectInfo
// __LLBLGENPRO_USER_CODE_REGION_END
base.GetObjectData(info, context);
}
/// Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.
/// Name of the property.
/// Entity to set as an related entity
/// Used by prefetch path logic.
[EditorBrowsable(EditorBrowsableState.Never)]
public override void SetRelatedEntityProperty(string propertyName, IEntity entity)
{
switch(propertyName)
{
case "SnippetGroup":
_alreadyFetchedSnippetGroup = true;
this.SnippetGroup = (SnippetGroupEntity)entity;
break;
default:
break;
}
}
/// Sets the internal parameter related to the fieldname passed to the instance relatedEntity.
/// Instance to set as the related entity of type entityType
/// Name of field mapped onto the relation which resolves in the instance relatedEntity
[EditorBrowsable(EditorBrowsableState.Never)]
public override void SetRelatedEntity(IEntity relatedEntity, string fieldName)
{
switch(fieldName)
{
case "SnippetGroup":
SetupSyncSnippetGroup(relatedEntity);
OnRelatedEntitySet(relatedEntity, fieldName);
break;
default:
break;
}
}
/// Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity()
/// Instance to unset as the related entity of type entityType
/// Name of field mapped onto the relation which resolves in the instance relatedEntity
/// if set to true it will notify the manytoone side, if applicable.
[EditorBrowsable(EditorBrowsableState.Never)]
public override void UnsetRelatedEntity(IEntity relatedEntity, string fieldName, bool signalRelatedEntityManyToOne)
{
switch(fieldName)
{
case "SnippetGroup":
DesetupSyncSnippetGroup(false, true);
OnRelatedEntityUnset(relatedEntity, fieldName);
break;
default:
break;
}
}
/// Gets a collection of related entities referenced by this entity which depend on this entity (this entity is the PK side of their FK fields). These
/// entities will have to be persisted after this entity during a recursive save.
/// Collection with 0 or more IEntity objects, referenced by this entity
public override List GetDependingRelatedEntities()
{
List toReturn = new List();
return toReturn;
}
/// Gets a collection of related entities referenced by this entity which this entity depends on (this entity is the FK side of their PK fields). These
/// entities will have to be persisted before this entity during a recursive save.
/// Collection with 0 or more IEntity objects, referenced by this entity
public override List GetDependentRelatedEntities()
{
List toReturn = new List();
if(_snippetGroup!=null)
{
toReturn.Add(_snippetGroup);
}
return toReturn;
}
/// Gets a List of all entity collections stored as member variables in this entity. The contents of the ArrayList is
/// used by the DataAccessAdapter to perform recursive saves. Only 1:n related collections are returned.
/// Collection with 0 or more IEntityCollection objects, referenced by this entity
public override List GetMemberEntityCollections()
{
List toReturn = new List();
return toReturn;
}
/// Fetches the contents of this entity from the persistent storage using the primary key.
/// PK value for Snippet which data should be fetched into this Snippet object
/// True if succeeded, false otherwise.
public bool FetchUsingPK(System.Int32 snippetId)
{
return FetchUsingPK(snippetId, null, null);
}
/// Fetches the contents of this entity from the persistent storage using the primary key.
/// PK value for Snippet which data should be fetched into this Snippet object
/// the PrefetchPath which defines the graph of objects to fetch as well
/// True if succeeded, false otherwise.
public bool FetchUsingPK(System.Int32 snippetId, IPrefetchPath prefetchPathToUse)
{
return FetchUsingPK(snippetId, prefetchPathToUse, null);
}
/// Fetches the contents of this entity from the persistent storage using the primary key.
/// PK value for Snippet which data should be fetched into this Snippet object
/// the PrefetchPath which defines the graph of objects to fetch as well
/// The context to add the entity to if the fetch was succesful.
/// True if succeeded, false otherwise.
public bool FetchUsingPK(System.Int32 snippetId, IPrefetchPath prefetchPathToUse, Context contextToUse)
{
return Fetch(snippetId, prefetchPathToUse, contextToUse);
}
/// Refetches the Entity from the persistent storage. Refetch is used to re-load an Entity which is marked "Out-of-sync", due to a save action.
/// Refetching an empty Entity has no effect.
/// true if Refetch succeeded, false otherwise
public override bool Refetch()
{
return Fetch(this.SnippetId, null, null);
}
/// Deletes the Entity from the persistent storage. This method succeeds also when the Entity is not present.
/// Predicate expression, meant for concurrency checks in a delete query. Overrules the predicate returned by a set ConcurrencyPredicateFactory object.
/// true if Delete succeeded, false otherwise
public override bool Delete(IPredicate deleteRestriction)
{
bool transactionStartedInThisScope = false;
Transaction transactionManager = null;
if((this.LLBLGenProIsInHierarchyOfType==InheritanceHierarchyType.TargetPerEntity) && this.LLBLGenProIsSubType)
{
if(!base.ParticipatesInTransaction)
{
transactionManager = new Transaction(IsolationLevel.ReadCommitted, "DeleteEntity");
transactionManager.Add(this);
transactionStartedInThisScope=true;
}
}
try
{
OnValidateEntityBeforeDelete();
OnDelete();
IDao dao = CreateDAOInstance();
bool wasSuccesful = dao.DeleteExisting(base.Fields, base.Transaction, deleteRestriction);
if(wasSuccesful)
{
base.Delete(deleteRestriction);
}
else
{
if(deleteRestriction!=null)
{
throw new ORMConcurrencyException("The delete action of an entity failed, probably due to the set delete restriction provided. The entity which failed is enclosed.", this);
}
}
if(transactionStartedInThisScope)
{
transactionManager.Commit();
}
return wasSuccesful;
}
catch
{
if(transactionStartedInThisScope)
{
transactionManager.Rollback();
}
throw;
}
finally
{
if(transactionStartedInThisScope)
{
transactionManager.Dispose();
}
OnDeleteComplete();
}
}
/// Returns true if the original value for the field with the fieldIndex passed in, read from the persistent storage was NULL, false otherwise.
/// Should not be used for testing if the current value is NULL, use for that.
/// Index of the field to test if that field was NULL in the persistent storage
/// true if the field with the passed in index was NULL in the persistent storage, false otherwise
public bool TestOriginalFieldValueForNull(SnippetFieldIndex fieldIndex)
{
return base.Fields[(int)fieldIndex].IsNull;
}
/// Returns true if the current value for the field with the fieldIndex passed in represents null/not defined, false otherwise.
/// Should not be used for testing if the original value (read from the db) is NULL
/// Index of the field to test if its currentvalue is null/undefined
/// true if the field's value isn't defined yet, false otherwise
public bool TestCurrentFieldValueForNull(SnippetFieldIndex fieldIndex)
{
return base.CheckIfCurrentFieldValueIsNull((int)fieldIndex);
}
/// Retrieves the related entity of type 'SnippetGroupEntity', using a relation of type 'n:1'
/// A fetched entity of type 'SnippetGroupEntity' which is related to this entity.
public SnippetGroupEntity GetSingleSnippetGroup()
{
return GetSingleSnippetGroup(false);
}
/// Retrieves the related entity of type 'SnippetGroupEntity', using a relation of type 'n:1'
/// if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage
/// A fetched entity of type 'SnippetGroupEntity' which is related to this entity.
public virtual SnippetGroupEntity GetSingleSnippetGroup(bool forceFetch)
{
if( ( !_alreadyFetchedSnippetGroup || forceFetch || _alwaysFetchSnippetGroup) && !base.IsSerializing && !base.IsDeserializing )
{
bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(SnippetEntity.Relations.SnippetGroupEntityUsingSnippetGroupId);
SnippetGroupEntity newEntity = new SnippetGroupEntity();
if(base.ParticipatesInTransaction)
{
base.Transaction.Add(newEntity);
}
bool fetchResult = false;
if(performLazyLoading)
{
fetchResult = newEntity.FetchUsingPK(this.SnippetGroupId.GetValueOrDefault());
}
if(fetchResult)
{
if(base.ActiveContext!=null)
{
newEntity = (SnippetGroupEntity)base.ActiveContext.Get(newEntity);
}
this.SnippetGroup = newEntity;
}
else
{
if(_snippetGroupReturnsNewIfNotFound)
{
if(performLazyLoading || (!performLazyLoading && (_snippetGroup == null)))
{
this.SnippetGroup = newEntity;
}
}
else
{
this.SnippetGroup = null;
}
}
_alreadyFetchedSnippetGroup = fetchResult;
if(base.ParticipatesInTransaction && !fetchResult)
{
base.Transaction.Remove(newEntity);
}
}
return _snippetGroup;
}
/// Sets the field on index fieldIndex to the new value value. Marks also the fields object as dirty.
/// Index of field to set the new value of
/// Value to set
/// If set to true, it will check if this entity is out of sync and will refetch it first if it is. Use true in normal behavior, false for framework specific code.
/// true if the value is actually set, false otherwise.
/// Dereferences a related object in an 1:1/m:1 relation if the field is an FK field and responsible for the reference of that particular related object.
/// When fieldIndex is smaller than 0 or bigger than the number of fields in the fields collection.
protected override bool SetNewFieldValue(int fieldIndex, object value, bool checkForRefetch)
{
bool toReturn = base.SetNewFieldValue (fieldIndex, value, checkForRefetch, false);
if(toReturn && Enum.IsDefined(typeof(SnippetFieldIndex), fieldIndex))
{
switch((SnippetFieldIndex)fieldIndex)
{
case SnippetFieldIndex.SnippetGroupId:
DesetupSyncSnippetGroup(true, false);
_alreadyFetchedSnippetGroup = false;
break;
default:
break;
}
base.PostFieldValueSetAction(toReturn, this.Fields[fieldIndex].Name);
}
return toReturn;
}
/// Performs the insert action of a new Entity to the persistent storage.
/// true if succeeded, false otherwise
protected override bool InsertEntity()
{
SnippetDAO dao = (SnippetDAO)CreateDAOInstance();
return dao.AddNew(base.Fields, base.Transaction);
}
/// Adds the internals to the active context.
protected override void AddInternalsToContext()
{
if(_snippetGroup!=null)
{
_snippetGroup.ActiveContext = base.ActiveContext;
}
}
/// Performs the update action of an existing Entity to the persistent storage.
/// true if succeeded, false otherwise
protected override bool UpdateEntity()
{
SnippetDAO dao = (SnippetDAO)CreateDAOInstance();
return dao.UpdateExisting(base.Fields, base.Transaction);
}
/// Performs the update action of an existing Entity to the persistent storage.
/// Predicate expression, meant for concurrency checks in an Update query
/// true if succeeded, false otherwise
protected override bool UpdateEntity(IPredicate updateRestriction)
{
SnippetDAO dao = (SnippetDAO)CreateDAOInstance();
return dao.UpdateExisting(base.Fields, base.Transaction, updateRestriction);
}
/// Initializes the class with empty data, as if it is a new Entity.
/// Validator to use.
protected virtual void InitClassEmpty(IValidator validatorToUse)
{
OnInitializing();
base.Fields = CreateFields();
base.IsNew=true;
base.Validator = validatorToUse;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
/// Creates entity fields object for this entity. Used in constructor to setup this entity in a polymorphic scenario.
protected virtual IEntityFields CreateFields()
{
return EntityFieldsFactory.CreateEntityFieldsObject(DataFeedFrameworkDAL.EntityType.SnippetEntity);
}
/// Initializes the the entity and fetches the data related to the entity in this entity.
/// PK value for Snippet which data should be fetched into this Snippet object
/// The validator object for this SnippetEntity
/// the PrefetchPath which defines the graph of objects to fetch as well
protected virtual void InitClassFetch(System.Int32 snippetId, IValidator validator, IPrefetchPath prefetchPathToUse)
{
OnInitializing();
InitClassMembers();
base.Fields = CreateFields();
bool wasSuccesful = Fetch(snippetId, prefetchPathToUse, null);
base.IsNew = !wasSuccesful;
base.Validator = validator;
// __LLBLGENPRO_USER_CODE_REGION_START InitClassFetch
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
/// Initializes the class members
private void InitClassMembers()
{
_snippetGroup = null;
_snippetGroupReturnsNewIfNotFound = true;
_alwaysFetchSnippetGroup = false;
_alreadyFetchedSnippetGroup = false;
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
}
#region Custom Property Hashtable Setup
/// Initializes the hashtables for the entity type and entity field custom properties.
private static void SetupCustomPropertyHashtables()
{
_customProperties = new Dictionary();
_fieldsCustomProperties = new Dictionary>();
Dictionary fieldHashtable = null;
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetId", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetGroupId", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetTitle", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetDescription", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetExtra", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetOrder", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetValidBegin", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetValidEnd", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetModifiedDate", fieldHashtable);
fieldHashtable = new Dictionary();
_fieldsCustomProperties.Add("SnippetCreationDate", fieldHashtable);
}
#endregion
/// Removes the sync logic for member _snippetGroup
/// If set to true, it will call the related entity's UnsetRelatedEntity method
/// if set to true it will also reset the FK fields pointing to the related entity
private void DesetupSyncSnippetGroup(bool signalRelatedEntity, bool resetFKFields)
{
base.PerformDesetupSyncRelatedEntity( _snippetGroup, new PropertyChangedEventHandler( OnSnippetGroupPropertyChanged ), "SnippetGroup", SnippetEntity.Relations.SnippetGroupEntityUsingSnippetGroupId, true, signalRelatedEntity, "Snippet", resetFKFields, new int[] { (int)SnippetFieldIndex.SnippetGroupId } );
_snippetGroup = null;
}
/// setups the sync logic for member _snippetGroup
/// Instance to set as the related entity of type entityType
private void SetupSyncSnippetGroup(IEntity relatedEntity)
{
DesetupSyncSnippetGroup(true, true);
_snippetGroup = (SnippetGroupEntity)relatedEntity;
base.PerformSetupSyncRelatedEntity( _snippetGroup, new PropertyChangedEventHandler( OnSnippetGroupPropertyChanged ), "SnippetGroup", SnippetEntity.Relations.SnippetGroupEntityUsingSnippetGroupId, true, ref _alreadyFetchedSnippetGroup, new string[] { } );
}
/// Handles property change events of properties in a related entity.
///
///
private void OnSnippetGroupPropertyChanged( object sender, PropertyChangedEventArgs e )
{
switch( e.PropertyName )
{
default:
break;
}
}
/// Fetches the entity from the persistent storage. Fetch simply reads the entity into an EntityFields object.
/// PK value for Snippet which data should be fetched into this Snippet object
/// the PrefetchPath which defines the graph of objects to fetch as well
/// The context to add the entity to if the fetch was succesful.
/// True if succeeded, false otherwise.
private bool Fetch(System.Int32 snippetId, IPrefetchPath prefetchPathToUse, Context contextToUse)
{
try
{
OnFetch();
IDao dao = this.CreateDAOInstance();
base.Fields[(int)SnippetFieldIndex.SnippetId].ForcedCurrentValueWrite(snippetId);
dao.FetchExisting(this, base.Transaction, prefetchPathToUse, contextToUse);
return (base.Fields.State == EntityState.Fetched);
}
finally
{
OnFetchComplete();
}
}
/// Creates the DAO instance for this type
///
protected override IDao CreateDAOInstance()
{
return DAOFactory.CreateSnippetDAO();
}
/// Creates the entity factory for this type.
///
protected override IEntityFactory CreateEntityFactory()
{
return new SnippetEntityFactory();
}
#region Class Property Declarations
/// The relations object holding all relations of this entity with other entity classes.
public static SnippetRelations Relations
{
get { return new SnippetRelations(); }
}
/// The custom properties for this entity type.
/// The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.
public static Dictionary CustomProperties
{
get { return _customProperties;}
}
/// Creates a new PrefetchPathElement object which contains all the information to prefetch the related entities of type 'SnippetGroup'
/// for this entity. Add the object returned by this property to an existing PrefetchPath instance.
/// Ready to use IPrefetchPathElement implementation.
public static IPrefetchPathElement PrefetchPathSnippetGroup
{
get
{
return new PrefetchPathElement(new DataFeedFrameworkDAL.CollectionClasses.SnippetGroupCollection(),
SnippetEntity.Relations.SnippetGroupEntityUsingSnippetGroupId,
(int)DataFeedFrameworkDAL.EntityType.SnippetEntity, (int)DataFeedFrameworkDAL.EntityType.SnippetGroupEntity, 0, null, null, null, "SnippetGroup", SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne);
}
}
/// Returns the full name for this entity, which is important for the DAO to find back persistence info for this entity.
[Browsable(false), XmlIgnore]
public override string LLBLGenProEntityName
{
get { return "SnippetEntity";}
}
/// The custom properties for the type of this entity instance.
/// The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.
[Browsable(false), XmlIgnore]
public virtual Dictionary CustomPropertiesOfType
{
get { return SnippetEntity.CustomProperties;}
}
/// The custom properties for the fields of this entity type. The returned Hashtable contains per fieldname a hashtable of name-value pairs.
/// The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.
public static Dictionary> FieldsCustomProperties
{
get { return _fieldsCustomProperties;}
}
/// The custom properties for the fields of the type of this entity instance. The returned Hashtable contains per fieldname a hashtable of name-value pairs.
/// The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.
[Browsable(false), XmlIgnore]
public virtual Dictionary> FieldsCustomPropertiesOfType
{
get { return SnippetEntity.FieldsCustomProperties;}
}
/// The SnippetId property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetId"
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): false, true, true
public virtual System.Int32 SnippetId
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetId);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.Int32));
}
return (System.Int32)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetId, value); }
}
/// The SnippetGroupId property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetGroupId"
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual Nullable SnippetGroupId
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetGroupId);
return (Nullable)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetGroupId, value); }
}
/// The SnippetTitle property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetTitle"
/// Table field type characteristics (type, precision, scale, length): VarChar, 0, 0, 200
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.String SnippetTitle
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetTitle);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.String));
}
return (System.String)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetTitle, value); }
}
/// The SnippetDescription property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetDescription"
/// Table field type characteristics (type, precision, scale, length): Text, 0, 0, 2147483647
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String SnippetDescription
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetDescription);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.String));
}
return (System.String)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetDescription, value); }
}
/// The SnippetExtra property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetExtra"
/// Table field type characteristics (type, precision, scale, length): VarChar, 0, 0, 200
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String SnippetExtra
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetExtra);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.String));
}
return (System.String)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetExtra, value); }
}
/// The SnippetOrder property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetOrder"
/// Table field type characteristics (type, precision, scale, length): Int, 10, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.Int32 SnippetOrder
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetOrder);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.Int32));
}
return (System.Int32)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetOrder, value); }
}
/// The SnippetValidBegin property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetValidBegin"
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual Nullable SnippetValidBegin
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetValidBegin);
return (Nullable)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetValidBegin, value); }
}
/// The SnippetValidEnd property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetValidEnd"
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual Nullable SnippetValidEnd
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetValidEnd);
return (Nullable)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetValidEnd, value); }
}
/// The SnippetModifiedDate property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetModifiedDate"
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.DateTime SnippetModifiedDate
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetModifiedDate);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.DateTime));
}
return (System.DateTime)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetModifiedDate, value); }
}
/// The SnippetCreationDate property of the Entity Snippet
///
/// Mapped on table field: "Snippet"."SnippetCreationDate"
/// Table field type characteristics (type, precision, scale, length): DateTime, 0, 0, 0
/// Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.DateTime SnippetCreationDate
{
get
{
object valueToReturn = base.GetCurrentFieldValue((int)SnippetFieldIndex.SnippetCreationDate);
if(valueToReturn == null)
{
valueToReturn = TypeDefaultValue.GetDefaultValue(typeof(System.DateTime));
}
return (System.DateTime)valueToReturn;
}
set { SetNewFieldValue((int)SnippetFieldIndex.SnippetCreationDate, value); }
}
/// Gets / sets related entity of type 'SnippetGroupEntity'. This property is not visible in databound grids.
/// Setting this property to a new object will make the load-on-demand feature to stop fetching data from the database, until you set this
/// property to null. Setting this property to an entity will make sure that FK-PK relations are synchronized when appropriate.
/// This property is added for conveniance, however it is recommeded to use the method 'GetSingleSnippetGroup()', because
/// this property is rather expensive and a method tells the user to cache the result when it has to be used more than once in the
/// same scope. The property is marked non-browsable to make it hidden in bound controls, f.e. datagrids.
[Browsable(false)]
public virtual SnippetGroupEntity SnippetGroup
{
get { return GetSingleSnippetGroup(false); }
set
{
if(base.IsDeserializing)
{
SetupSyncSnippetGroup(value);
}
else
{
if(value==null)
{
if(_snippetGroup != null)
{
_snippetGroup.UnsetRelatedEntity(this, "Snippet");
}
}
else
{
((IEntity)value).SetRelatedEntity(this, "Snippet");
}
}
}
}
/// Gets / sets the lazy loading flag for SnippetGroup. When set to true, SnippetGroup is always refetched from the
/// persistent storage. When set to false, the data is only fetched the first time SnippetGroup is accessed. You can always execute
/// a forced fetch by calling GetSingleSnippetGroup(true).
[Browsable(false)]
public bool AlwaysFetchSnippetGroup
{
get { return _alwaysFetchSnippetGroup; }
set { _alwaysFetchSnippetGroup = value; }
}
/// Gets / sets the flag for what to do if the related entity available through the property SnippetGroup is not found
/// in the database. When set to true, SnippetGroup will return a new entity instance if the related entity is not found, otherwise
/// null be returned if the related entity is not found. Default: true.
[Browsable(false)]
public bool SnippetGroupReturnsNewIfNotFound
{
get { return _snippetGroupReturnsNewIfNotFound; }
set { _snippetGroupReturnsNewIfNotFound = value; }
}
/// Gets or sets a value indicating whether this entity is a subtype
protected override bool LLBLGenProIsSubType
{
get { return false;}
}
/// Gets the type of the hierarchy this entity is in.
[System.ComponentModel.Browsable(false), XmlIgnore]
protected override InheritanceHierarchyType LLBLGenProIsInHierarchyOfType
{
get { return InheritanceHierarchyType.None;}
}
/// Returns the EntityType enum value for this entity.
[Browsable(false), XmlIgnore]
public override int LLBLGenProEntityTypeValue
{
get { return (int)DataFeedFrameworkDAL.EntityType.SnippetEntity; }
}
#endregion
#region Custom Entity code
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
#endregion
#region Included code
#endregion
}
}