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

250 lines
11 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 'TblField'.<br/><br/></summary>
[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();
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblSubject</summary>
public static readonly string TblSubject = "TblSubject";
}
/// <summary>Static meta-data storage for navigator related information</summary>
protected class TblFieldEntityStaticMetaData : EntityStaticMetaDataBase
{
public TblFieldEntityStaticMetaData()
{
SetEntityCoreInfo("TblFieldEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblFieldEntity, typeof(TblFieldEntity), typeof(TblFieldEntityFactory), false);
AddNavigatorMetaData<TblFieldEntity, TblSubjectEntity>("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);
}
}
/// <summary>Static ctor</summary>
static TblFieldEntity()
{
}
/// <summary> CTor</summary>
public TblFieldEntity()
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblFieldEntity(IEntityFields2 fields)
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblFieldEntity</param>
public TblFieldEntity(IValidator validator)
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="uniqueId">PK value for TblField which data should be fetched into this TblField object</param>
public TblFieldEntity(System.String uniqueId) : this(uniqueId, null)
{
}
/// <summary> CTor</summary>
/// <param name="uniqueId">PK value for TblField which data should be fetched into this TblField object</param>
/// <param name="validator">The custom validator object for this TblFieldEntity</param>
public TblFieldEntity(System.String uniqueId, IValidator validator)
{
InitClassEmpty(validator, null);
this.UniqueId = uniqueId;
}
/// <summary>Private CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected TblFieldEntity(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 entity of type 'TblSubject' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblSubject() { return CreateRelationInfoForNavigator("TblSubject"); }
/// <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 TblFieldEntity</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 TblFieldRelations Relations { get { return _relationsFactory; } }
/// <summary>Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblSubject' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblSubject { get { return _staticMetaData.GetPrefetchPathElement("TblSubject", CommonEntityBase.CreateEntityCollection<TblSubjectEntity>()); } }
/// <summary>The Description property of the Entity TblField<br/><br/></summary>
/// <remarks>Mapped on table field: "tblFields"."Description".<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 Description
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.Description, true); }
set { SetValue((int)TblFieldFieldIndex.Description, value); }
}
/// <summary>The FieldId property of the Entity TblField<br/><br/></summary>
/// <remarks>Mapped on table field: "tblFields"."FieldID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 1.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String FieldId
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.FieldId, true); }
set { SetValue((int)TblFieldFieldIndex.FieldId, value); }
}
/// <summary>The FieldName property of the Entity TblField<br/><br/></summary>
/// <remarks>Mapped on table field: "tblFields"."FieldName".<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 FieldName
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.FieldName, true); }
set { SetValue((int)TblFieldFieldIndex.FieldName, value); }
}
/// <summary>The Prefix property of the Entity TblField<br/><br/></summary>
/// <remarks>Mapped on table field: "tblFields"."Prefix".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String Prefix
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.Prefix, true); }
set { SetValue((int)TblFieldFieldIndex.Prefix, value); }
}
/// <summary>The SubjectId property of the Entity TblField<br/><br/></summary>
/// <remarks>Mapped on table field: "tblFields"."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): true, false, false</remarks>
public virtual System.String SubjectId
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.SubjectId, true); }
set { SetValue((int)TblFieldFieldIndex.SubjectId, value); }
}
/// <summary>The UniqueId property of the Entity TblField<br/><br/></summary>
/// <remarks>Mapped on table field: "tblFields"."UniqueID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.<br/>Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String UniqueId
{
get { return (System.String)GetValue((int)TblFieldFieldIndex.UniqueId, true); }
set { SetValue((int)TblFieldFieldIndex.UniqueId, value); }
}
/// <summary>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..<br/><br/></summary>
[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
{
///<summary>Description. </summary>
Description,
///<summary>FieldId. </summary>
FieldId,
///<summary>FieldName. </summary>
FieldName,
///<summary>Prefix. </summary>
Prefix,
///<summary>SubjectId. </summary>
SubjectId,
///<summary>UniqueId. </summary>
UniqueId,
/// <summary></summary>
AmountOfFields
}
}
namespace Datalib.RelationClasses
{
/// <summary>Implements the relations factory for the entity: TblField. </summary>
public partial class TblFieldRelations: RelationFactory
{
/// <summary>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</summary>
public virtual IEntityRelation TblSubjectEntityUsingSubjectId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblSubject", false, new[] { TblSubjectFields.SubjectId, TblFieldFields.SubjectId }); }
}
}
/// <summary>Static class which is used for providing relationship instances which are re-used internally for syncing</summary>
internal static class StaticTblFieldRelations
{
internal static readonly IEntityRelation TblSubjectEntityUsingSubjectIdStatic = new TblFieldRelations().TblSubjectEntityUsingSubjectId;
/// <summary>CTor</summary>
static StaticTblFieldRelations() { }
}
}