///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using Datalib;
using Datalib.FactoryClasses;
using Datalib.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
namespace Datalib.RelationClasses
{
/// Implements the relations factory for the entity: TblPatient.
public partial class TblPatientRelations
{
/// CTor
public TblPatientRelations()
{
}
/// Gets all relations of the TblPatientEntity as a list of IEntityRelation objects.
/// a list of IEntityRelation objects
public virtual List GetAllRelations()
{
List toReturn = new List();
toReturn.Add(this.TblClinicInfoEntityUsingPatientId);
toReturn.Add(this.TblDiaryEntityUsingPatientId);
toReturn.Add(this.TblExaminationInfoEntityUsingPatientId);
toReturn.Add(this.TblPreClinicsInfoEntityUsingPatientId);
toReturn.Add(this.TblPregnanceInfoEntityUsingPatientId);
toReturn.Add(this.TblReferralsToEntityUsingPatientId);
toReturn.Add(this.TblReferraltoServiceEntityUsingPatientId);
toReturn.Add(this.TblTreatmentInfoEntityUsingPatientId);
toReturn.Add(this.TblReferralFromPlaceEntityUsingReferralId);
return toReturn;
}
#region Class Property Declarations
/// Returns a new IEntityRelation object, between TblPatientEntity and TblClinicInfoEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblClinicInfo.PatientId
///
public virtual IEntityRelation TblClinicInfoEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblClinicInfos" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblClinicInfoFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblClinicInfoEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblDiaryEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblDiary.PatientId
///
public virtual IEntityRelation TblDiaryEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblDiaries" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblDiaryFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblDiaryEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblExaminationInfoEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblExaminationInfo.PatientId
///
public virtual IEntityRelation TblExaminationInfoEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblExaminationInfos" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblExaminationInfoFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblExaminationInfoEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblPreClinicsInfoEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblPreClinicsInfo.PatientId
///
public virtual IEntityRelation TblPreClinicsInfoEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblPreClinicsInfos" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblPreClinicsInfoFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPreClinicsInfoEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblPregnanceInfoEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblPregnanceInfo.PatientId
///
public virtual IEntityRelation TblPregnanceInfoEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblPregnanceInfos" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblPregnanceInfoFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPregnanceInfoEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblReferralsToEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblReferralsTo.PatientId
///
public virtual IEntityRelation TblReferralsToEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblReferralsTos" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblReferralsToFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblReferralsToEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblReferraltoServiceEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblReferraltoService.PatientId
///
public virtual IEntityRelation TblReferraltoServiceEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblReferraltoServices" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblReferraltoServiceFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblReferraltoServiceEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblTreatmentInfoEntity over the 1:n relation they have, using the relation between the fields:
/// TblPatient.PatientId - TblTreatmentInfo.PatientId
///
public virtual IEntityRelation TblTreatmentInfoEntityUsingPatientId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.OneToMany, "TblTreatmentInfos" , true);
relation.AddEntityFieldPair(TblPatientFields.PatientId, TblTreatmentInfoFields.PatientId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblTreatmentInfoEntity", false);
return relation;
}
}
/// Returns a new IEntityRelation object, between TblPatientEntity and TblReferralFromPlaceEntity over the m:1 relation they have, using the relation between the fields:
/// TblPatient.ReferralId - TblReferralFromPlace.ReferralId
///
public virtual IEntityRelation TblReferralFromPlaceEntityUsingReferralId
{
get
{
IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "TblReferralFromPlace", false);
relation.AddEntityFieldPair(TblReferralFromPlaceFields.ReferralId, TblPatientFields.ReferralId);
relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblReferralFromPlaceEntity", false);
relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TblPatientEntity", true);
return relation;
}
}
/// stub, not used in this entity, only for TargetPerEntity entities.
public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; }
/// stub, not used in this entity, only for TargetPerEntity entities.
public virtual IEntityRelation GetSuperTypeRelation() { return null;}
#endregion
#region Included Code
#endregion
}
/// Static class which is used for providing relationship instances which are re-used internally for syncing
internal static class StaticTblPatientRelations
{
internal static readonly IEntityRelation TblClinicInfoEntityUsingPatientIdStatic = new TblPatientRelations().TblClinicInfoEntityUsingPatientId;
internal static readonly IEntityRelation TblDiaryEntityUsingPatientIdStatic = new TblPatientRelations().TblDiaryEntityUsingPatientId;
internal static readonly IEntityRelation TblExaminationInfoEntityUsingPatientIdStatic = new TblPatientRelations().TblExaminationInfoEntityUsingPatientId;
internal static readonly IEntityRelation TblPreClinicsInfoEntityUsingPatientIdStatic = new TblPatientRelations().TblPreClinicsInfoEntityUsingPatientId;
internal static readonly IEntityRelation TblPregnanceInfoEntityUsingPatientIdStatic = new TblPatientRelations().TblPregnanceInfoEntityUsingPatientId;
internal static readonly IEntityRelation TblReferralsToEntityUsingPatientIdStatic = new TblPatientRelations().TblReferralsToEntityUsingPatientId;
internal static readonly IEntityRelation TblReferraltoServiceEntityUsingPatientIdStatic = new TblPatientRelations().TblReferraltoServiceEntityUsingPatientId;
internal static readonly IEntityRelation TblTreatmentInfoEntityUsingPatientIdStatic = new TblPatientRelations().TblTreatmentInfoEntityUsingPatientId;
internal static readonly IEntityRelation TblReferralFromPlaceEntityUsingReferralIdStatic = new TblPatientRelations().TblReferralFromPlaceEntityUsingReferralId;
/// CTor
static StaticTblPatientRelations()
{
}
}
}