/// <summary> setups the sync logic for member _malat</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncMalat(IEntity relatedEntity) { if(_malat!=relatedEntity) { DesetupSyncMalat(true, true); _malat = (MAlatEntity)relatedEntity; base.PerformSetupSyncRelatedEntity( _malat, new PropertyChangedEventHandler( OnMalatPropertyChanged ), "Malat", THistoryAlatEntity.Relations.MAlatEntityUsingCIdAlat, true, ref _alreadyFetchedMalat, new string[] { } ); } }
/// <summary> Initializes the class members</summary> private void InitClassMembers() { _malat = null; _malatReturnsNewIfNotFound = true; _alwaysFetchMalat = false; _alreadyFetchedMalat = false; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
/// <summary> Removes the sync logic for member _malat</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncMalat(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity( _malat, new PropertyChangedEventHandler( OnMalatPropertyChanged ), "Malat", THistoryAlatEntity.Relations.MAlatEntityUsingCIdAlat, true, signalRelatedEntity, "ThistoryAlat", resetFKFields, new int[] { (int)THistoryAlatFieldIndex.CIdAlat } ); _malat = null; }
/// <summary> Retrieves the related entity of type 'MAlatEntity', using a relation of type 'n:1'</summary> /// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param> /// <returns>A fetched entity of type 'MAlatEntity' which is related to this entity.</returns> public virtual MAlatEntity GetSingleMalat(bool forceFetch) { if( ( !_alreadyFetchedMalat || forceFetch || _alwaysFetchMalat) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode) { bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(THistoryAlatEntity.Relations.MAlatEntityUsingCIdAlat); MAlatEntity newEntity = new MAlatEntity(); if(base.ParticipatesInTransaction) { base.Transaction.Add(newEntity); } bool fetchResult = false; if(performLazyLoading) { fetchResult = newEntity.FetchUsingPK(this.CIdAlat); } if(fetchResult) { if(base.ActiveContext!=null) { newEntity = (MAlatEntity)base.ActiveContext.Get(newEntity); } this.Malat = newEntity; } else { if(_malatReturnsNewIfNotFound) { if(performLazyLoading || (!performLazyLoading && (_malat == null))) { this.Malat = newEntity; } } else { this.Malat = null; } } _alreadyFetchedMalat = fetchResult; if(base.ParticipatesInTransaction && !fetchResult) { base.Transaction.Remove(newEntity); } } return _malat; }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected THistoryAlatEntity(SerializationInfo info, StreamingContext context) : base(info, context) { _malat = (MAlatEntity)info.GetValue("_malat", typeof(MAlatEntity)); if(_malat!=null) { _malat.AfterSave+=new EventHandler(OnEntityAfterSave); } _malatReturnsNewIfNotFound = info.GetBoolean("_malatReturnsNewIfNotFound"); _alwaysFetchMalat = info.GetBoolean("_alwaysFetchMalat"); _alreadyFetchedMalat = info.GetBoolean("_alreadyFetchedMalat"); base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary>Creates a new, empty MAlatEntity object.</summary> /// <returns>A new, empty MAlatEntity object.</returns> public override IEntity Create() { IEntity toReturn = new MAlatEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewMAlat // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }