Files
csharpcode/omegapro/Datalib/DatabaseGeneric/EntityClasses/TblSubjectEntity.cs
2025-08-02 05:20:17 +07:00

238 lines
12 KiB
C#

//////////////////////////////////////////////////////////////
// <auto-generated>This code was generated by LLBLGen Pro 5.7.</auto-generated>
//////////////////////////////////////////////////////////////
// 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
/// <summary>Entity class which represents the entity 'TblSubject'.<br/><br/></summary>
[Serializable]
public partial class TblSubjectEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
private EntityCollection<TblFieldEntity> _tblFields;
private EntityCollection<TblQuestionEntity> _tblQuestions;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
private static TblSubjectEntityStaticMetaData _staticMetaData = new TblSubjectEntityStaticMetaData();
private static TblSubjectRelations _relationsFactory = new TblSubjectRelations();
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblFields</summary>
public static readonly string TblFields = "TblFields";
/// <summary>Member name TblQuestions</summary>
public static readonly string TblQuestions = "TblQuestions";
}
/// <summary>Static meta-data storage for navigator related information</summary>
protected class TblSubjectEntityStaticMetaData : EntityStaticMetaDataBase
{
public TblSubjectEntityStaticMetaData()
{
SetEntityCoreInfo("TblSubjectEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblSubjectEntity, typeof(TblSubjectEntity), typeof(TblSubjectEntityFactory), false);
AddNavigatorMetaData<TblSubjectEntity, EntityCollection<TblFieldEntity>>("TblFields", a => a._tblFields, (a, b) => a._tblFields = b, a => a.TblFields, () => new TblSubjectRelations().TblFieldEntityUsingSubjectId, typeof(TblFieldEntity), (int)Datalib.EntityType.TblFieldEntity);
AddNavigatorMetaData<TblSubjectEntity, EntityCollection<TblQuestionEntity>>("TblQuestions", a => a._tblQuestions, (a, b) => a._tblQuestions = b, a => a.TblQuestions, () => new TblSubjectRelations().TblQuestionEntityUsingSubjectId, typeof(TblQuestionEntity), (int)Datalib.EntityType.TblQuestionEntity);
}
}
/// <summary>Static ctor</summary>
static TblSubjectEntity()
{
}
/// <summary> CTor</summary>
public TblSubjectEntity()
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblSubjectEntity(IEntityFields2 fields)
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblSubjectEntity</param>
public TblSubjectEntity(IValidator validator)
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="subjectId">PK value for TblSubject which data should be fetched into this TblSubject object</param>
public TblSubjectEntity(System.String subjectId) : this(subjectId, null)
{
}
/// <summary> CTor</summary>
/// <param name="subjectId">PK value for TblSubject which data should be fetched into this TblSubject object</param>
/// <param name="validator">The custom validator object for this TblSubjectEntity</param>
public TblSubjectEntity(System.String subjectId, IValidator validator)
{
InitClassEmpty(validator, null);
this.SubjectId = subjectId;
}
/// <summary>Private CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected TblSubjectEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblField' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblFields() { return CreateRelationInfoForNavigator("TblFields"); }
/// <summary>Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblQuestion' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblQuestions() { return CreateRelationInfoForNavigator("TblQuestions"); }
/// <inheritdoc/>
protected override EntityStaticMetaDataBase GetEntityStaticMetaData() { return _staticMetaData; }
/// <summary>Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
/// <summary>Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblSubjectEntity</param>
/// <param name="fields">Fields of this entity</param>
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();
}
/// <summary>The relations object holding all relations of this entity with other entity classes.</summary>
public static TblSubjectRelations Relations { get { return _relationsFactory; } }
/// <summary>Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblField' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblFields { get { return _staticMetaData.GetPrefetchPathElement("TblFields", CommonEntityBase.CreateEntityCollection<TblFieldEntity>()); } }
/// <summary>Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuestion' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblQuestions { get { return _staticMetaData.GetPrefetchPathElement("TblQuestions", CommonEntityBase.CreateEntityCollection<TblQuestionEntity>()); } }
/// <summary>The SubjectDes property of the Entity TblSubject<br/><br/></summary>
/// <remarks>Mapped on table field: "tblSubjects"."SubjectDes".<br/>Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String SubjectDes
{
get { return (System.String)GetValue((int)TblSubjectFieldIndex.SubjectDes, true); }
set { SetValue((int)TblSubjectFieldIndex.SubjectDes, value); }
}
/// <summary>The SubjectId property of the Entity TblSubject<br/><br/></summary>
/// <remarks>Mapped on table field: "tblSubjects"."SubjectID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2.<br/>Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String SubjectId
{
get { return (System.String)GetValue((int)TblSubjectFieldIndex.SubjectId, true); }
set { SetValue((int)TblSubjectFieldIndex.SubjectId, value); }
}
/// <summary>The SubjectName property of the Entity TblSubject<br/><br/></summary>
/// <remarks>Mapped on table field: "tblSubjects"."SubjectName".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 50.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String SubjectName
{
get { return (System.String)GetValue((int)TblSubjectFieldIndex.SubjectName, true); }
set { SetValue((int)TblSubjectFieldIndex.SubjectName, value); }
}
/// <summary>Gets the EntityCollection with the related entities of type 'TblFieldEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblFieldEntity))]
public virtual EntityCollection<TblFieldEntity> TblFields { get { return GetOrCreateEntityCollection<TblFieldEntity, TblFieldEntityFactory>("TblSubject", true, false, ref _tblFields); } }
/// <summary>Gets the EntityCollection with the related entities of type 'TblQuestionEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblQuestionEntity))]
public virtual EntityCollection<TblQuestionEntity> TblQuestions { get { return GetOrCreateEntityCollection<TblQuestionEntity, TblQuestionEntityFactory>("TblSubject", true, false, ref _tblQuestions); } }
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
}
}
namespace Datalib
{
public enum TblSubjectFieldIndex
{
///<summary>SubjectDes. </summary>
SubjectDes,
///<summary>SubjectId. </summary>
SubjectId,
///<summary>SubjectName. </summary>
SubjectName,
/// <summary></summary>
AmountOfFields
}
}
namespace Datalib.RelationClasses
{
/// <summary>Implements the relations factory for the entity: TblSubject. </summary>
public partial class TblSubjectRelations: RelationFactory
{
/// <summary>Returns a new IEntityRelation object, between TblSubjectEntity and TblFieldEntity over the 1:n relation they have, using the relation between the fields: TblSubject.SubjectId - TblField.SubjectId</summary>
public virtual IEntityRelation TblFieldEntityUsingSubjectId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblFields", true, new[] { TblSubjectFields.SubjectId, TblFieldFields.SubjectId }); }
}
/// <summary>Returns a new IEntityRelation object, between TblSubjectEntity and TblQuestionEntity over the 1:n relation they have, using the relation between the fields: TblSubject.SubjectId - TblQuestion.SubjectId</summary>
public virtual IEntityRelation TblQuestionEntityUsingSubjectId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblQuestions", true, new[] { TblSubjectFields.SubjectId, TblQuestionFields.SubjectId }); }
}
}
/// <summary>Static class which is used for providing relationship instances which are re-used internally for syncing</summary>
internal static class StaticTblSubjectRelations
{
internal static readonly IEntityRelation TblFieldEntityUsingSubjectIdStatic = new TblSubjectRelations().TblFieldEntityUsingSubjectId;
internal static readonly IEntityRelation TblQuestionEntityUsingSubjectIdStatic = new TblSubjectRelations().TblQuestionEntityUsingSubjectId;
/// <summary>CTor</summary>
static StaticTblSubjectRelations() { }
}
}