/// <summary> setups the sync logic for member _status</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncStatus(IEntityCore relatedEntity)
		{
			if(_status!=relatedEntity)
			{
				DesetupSyncStatus(true, true);
				_status = (StatusRoEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _status, new PropertyChangedEventHandler( OnStatusPropertyChanged ), "Status", NinjaSoftware.Enio.CoolJ.RelationClasses.StaticRacunGlavaRelations.StatusRoEntityUsingStatusIdStatic, true, new string[] {  } );
			}
		}
		protected RacunGlavaEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_racunStavkaCollection = (EntityCollection<RacunStavkaEntity>)info.GetValue("_racunStavkaCollection", typeof(EntityCollection<RacunStavkaEntity>));
				_partner = (PartnerEntity)info.GetValue("_partner", typeof(PartnerEntity));
				if(_partner!=null)
				{
					_partner.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_status = (StatusRoEntity)info.GetValue("_status", typeof(StatusRoEntity));
				if(_status!=null)
				{
					_status.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_tarifa = (TarifaEntity)info.GetValue("_tarifa", typeof(TarifaEntity));
				if(_tarifa!=null)
				{
					_tarifa.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
		}
		/// <summary> Removes the sync logic for member _status</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 DesetupSyncStatus(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _status, new PropertyChangedEventHandler( OnStatusPropertyChanged ), "Status", NinjaSoftware.Enio.CoolJ.RelationClasses.StaticRacunGlavaRelations.StatusRoEntityUsingStatusIdStatic, true, signalRelatedEntity, "RacunGlavaCollection", resetFKFields, new int[] { (int)RacunGlavaFieldIndex.StatusId } );
			_status = null;
		}
		public static StatusRoEntity FetchStatusRo(DataAccessAdapterBase adapter, PrefetchPath2 prefetchPath, long StatusRoId)
		{
			StatusRoEntity _StatusRoEntity = new StatusRoEntity(StatusRoId);
			adapter.FetchEntity(_StatusRoEntity, prefetchPath);
			return _StatusRoEntity;
		}