//////////////////////////////////////////////////////////////
// This code was generated by LLBLGen Pro 5.7.
//////////////////////////////////////////////////////////////
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
//////////////////////////////////////////////////////////////
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using Datalib.HelperClasses;
using Datalib.FactoryClasses;
using Datalib.RelationClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.EntityClasses
{
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
// __LLBLGENPRO_USER_CODE_REGION_END
/// Entity class which represents the entity 'TblField'.
[Serializable]
public partial class TblFieldEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
private TblSubjectEntity _tblSubject;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
private static TblFieldEntityStaticMetaData _staticMetaData = new TblFieldEntityStaticMetaData();
private static TblFieldRelations _relationsFactory = new TblFieldRelations();
/// All names of fields mapped onto a relation. Usable for in-memory filtering
public static partial class MemberNames
{
/// Member name TblSubject
public static readonly string TblSubject = "TblSubject";
}
/// Static meta-data storage for navigator related information
protected class TblFieldEntityStaticMetaData : EntityStaticMetaDataBase
{
public TblFieldEntityStaticMetaData()
{
SetEntityCoreInfo("TblFieldEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblFieldEntity, typeof(TblFieldEntity), typeof(TblFieldEntityFactory), false);
AddNavigatorMetaData("TblSubject", "TblFields", (a, b) => a._tblSubject = b, a => a._tblSubject, (a, b) => a.TblSubject = b, Datalib.RelationClasses.StaticTblFieldRelations.TblSubjectEntityUsingSubjectIdStatic, ()=>new TblFieldRelations().TblSubjectEntityUsingSubjectId, null, new int[] { (int)TblFieldFieldIndex.SubjectId }, null, true, (int)Datalib.EntityType.TblSubjectEntity);
}
}
/// Static ctor
static TblFieldEntity()
{
}
/// CTor
public TblFieldEntity()
{
InitClassEmpty(null, null);
}
/// CTor
/// Fields object to set as the fields for this entity.
public TblFieldEntity(IEntityFields2 fields)
{
InitClassEmpty(null, fields);
}
/// CTor
/// The custom validator object for this TblFieldEntity
public TblFieldEntity(IValidator validator)
{
InitClassEmpty(validator, null);
}
/// CTor
/// PK value for TblField which data should be fetched into this TblField object
public TblFieldEntity(System.String uniqueId) : this(uniqueId, null)
{
}
/// CTor
/// PK value for TblField which data should be fetched into this TblField object
/// The custom validator object for this TblFieldEntity
public TblFieldEntity(System.String uniqueId, IValidator validator)
{
InitClassEmpty(validator, null);
this.UniqueId = uniqueId;
}
/// Private CTor for deserialization
///
///
protected TblFieldEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblSubject' to this entity.
///
public virtual IRelationPredicateBucket GetRelationInfoTblSubject() { return CreateRelationInfoForNavigator("TblSubject"); }
///
protected override EntityStaticMetaDataBase GetEntityStaticMetaData() { return _staticMetaData; }
/// Initializes the class members
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
/// Initializes the class with empty data, as if it is a new Entity.
/// The validator object for this TblFieldEntity
/// Fields of this entity
private void InitClassEmpty(IValidator validator, IEntityFields2 fields)
{
OnInitializing();
this.Fields = fields ?? CreateFields();
this.Validator = validator;
InitClassMembers();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitialized();
}
/// The relations object holding all relations of this entity with other entity classes.
public static TblFieldRelations Relations { get { return _relationsFactory; } }
/// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblSubject' for this entity.
/// Ready to use IPrefetchPathElement2 implementation.
public static IPrefetchPathElement2 PrefetchPathTblSubject { get { return _staticMetaData.GetPrefetchPathElement("TblSubject", CommonEntityBase.CreateEntityCollection()); } }
/// The Description property of the Entity TblField
/// Mapped on table field: "tblFields"."Description".
Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String Description
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.Description, true); }
set { SetValue((int)TblFieldFieldIndex.Description, value); }
}
/// The FieldId property of the Entity TblField
/// Mapped on table field: "tblFields"."FieldID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 1.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String FieldId
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.FieldId, true); }
set { SetValue((int)TblFieldFieldIndex.FieldId, value); }
}
/// The FieldName property of the Entity TblField
/// Mapped on table field: "tblFields"."FieldName".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 50.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String FieldName
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.FieldName, true); }
set { SetValue((int)TblFieldFieldIndex.FieldName, value); }
}
/// The Prefix property of the Entity TblField
/// Mapped on table field: "tblFields"."Prefix".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String Prefix
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.Prefix, true); }
set { SetValue((int)TblFieldFieldIndex.Prefix, value); }
}
/// The SubjectId property of the Entity TblField
/// Mapped on table field: "tblFields"."SubjectID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String SubjectId
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.SubjectId, true); }
set { SetValue((int)TblFieldFieldIndex.SubjectId, value); }
}
/// The UniqueId property of the Entity TblField
/// Mapped on table field: "tblFields"."UniqueID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.
Table field behavior characteristics (is nullable, is PK, is identity): false, true, false
public virtual System.String UniqueId
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.UniqueId, true); }
set { SetValue((int)TblFieldFieldIndex.UniqueId, value); }
}
/// Gets / sets related entity of type 'TblSubjectEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..
[Browsable(false)]
public virtual TblSubjectEntity TblSubject
{
get { return _tblSubject; }
set { SetSingleRelatedEntityNavigator(value, "TblSubject"); }
}
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
}
}
namespace Datalib
{
public enum TblFieldFieldIndex
{
///Description.
Description,
///FieldId.
FieldId,
///FieldName.
FieldName,
///Prefix.
Prefix,
///SubjectId.
SubjectId,
///UniqueId.
UniqueId,
///
AmountOfFields
}
}
namespace Datalib.RelationClasses
{
/// Implements the relations factory for the entity: TblField.
public partial class TblFieldRelations: RelationFactory
{
/// Returns a new IEntityRelation object, between TblFieldEntity and TblSubjectEntity over the m:1 relation they have, using the relation between the fields: TblField.SubjectId - TblSubject.SubjectId
public virtual IEntityRelation TblSubjectEntityUsingSubjectId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblSubject", false, new[] { TblSubjectFields.SubjectId, TblFieldFields.SubjectId }); }
}
}
/// Static class which is used for providing relationship instances which are re-used internally for syncing
internal static class StaticTblFieldRelations
{
internal static readonly IEntityRelation TblSubjectEntityUsingSubjectIdStatic = new TblFieldRelations().TblSubjectEntityUsingSubjectId;
/// CTor
static StaticTblFieldRelations() { }
}
}