コード例 #1
0
        /// <summary> Initializes the class members</summary>
        private void InitClassMembers()
        {
            _attributeValue = new policyDB.CollectionClasses.AttributeValueCollection(new AttributeValueEntityFactory());
            _attributeValue.SetContainingEntityInfo(this, "Attribute");
            _alwaysFetchAttributeValue = false;
            _alreadyFetchedAttributeValue = false;
            _decisionNode = new policyDB.CollectionClasses.DecisionNodeCollection(new DecisionNodeEntityFactory());
            _decisionNode.SetContainingEntityInfo(this, "Attribute");
            _alwaysFetchDecisionNode = false;
            _alreadyFetchedDecisionNode = false;
            _queryValue = new policyDB.CollectionClasses.QueryValueCollection(new QueryValueEntityFactory());
            _queryValue.SetContainingEntityInfo(this, "Attribute");
            _alwaysFetchQueryValue = false;
            _alreadyFetchedQueryValue = false;
            _decisionNodeCollectionViaDecisionNode = new policyDB.CollectionClasses.DecisionNodeCollection(new DecisionNodeEntityFactory());
            _alwaysFetchDecisionNodeCollectionViaDecisionNode = false;
            _alreadyFetchedDecisionNodeCollectionViaDecisionNode = false;
            _decisionNodeCollectionViaAttributeValue = new policyDB.CollectionClasses.DecisionNodeCollection(new DecisionNodeEntityFactory());
            _alwaysFetchDecisionNodeCollectionViaAttributeValue = false;
            _alreadyFetchedDecisionNodeCollectionViaAttributeValue = false;
            _queryCollectionViaQueryValue = new policyDB.CollectionClasses.QueryCollection(new QueryEntityFactory());
            _alwaysFetchQueryCollectionViaQueryValue = false;
            _alreadyFetchedQueryCollectionViaQueryValue = false;
            _attributeType = null;
            _attributeTypeReturnsNewIfNotFound = true;
            _alwaysFetchAttributeType = false;
            _alreadyFetchedAttributeType = false;
            _context = null;
            _contextReturnsNewIfNotFound = true;
            _alwaysFetchContext = false;
            _alreadyFetchedContext = false;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
コード例 #2
0
 /// <summary> setups the sync logic for member _attributeType</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncAttributeType(IEntity relatedEntity)
 {
     if(_attributeType!=relatedEntity)
     {
         DesetupSyncAttributeType(true, true);
         _attributeType = (AttributeTypeEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity( _attributeType, new PropertyChangedEventHandler( OnAttributeTypePropertyChanged ), "AttributeType", AttributeEntity.Relations.AttributeTypeEntityUsingAttributeTypeId, true, ref _alreadyFetchedAttributeType, new string[] {  } );
     }
 }
コード例 #3
0
 /// <summary> Removes the sync logic for member _attributeType</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 DesetupSyncAttributeType(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity( _attributeType, new PropertyChangedEventHandler( OnAttributeTypePropertyChanged ), "AttributeType", AttributeEntity.Relations.AttributeTypeEntityUsingAttributeTypeId, true, signalRelatedEntity, "Attribute", resetFKFields, new int[] { (int)AttributeFieldIndex.AttributeTypeId } );
     _attributeType = null;
 }
コード例 #4
0
        /// <summary> Retrieves the related entity of type 'AttributeTypeEntity', 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 'AttributeTypeEntity' which is related to this entity.</returns>
        public virtual AttributeTypeEntity GetSingleAttributeType(bool forceFetch)
        {
            if( ( !_alreadyFetchedAttributeType || forceFetch || _alwaysFetchAttributeType) && !base.IsSerializing && !base.IsDeserializing  && !base.InDesignMode)
            {
                bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(AttributeEntity.Relations.AttributeTypeEntityUsingAttributeTypeId);

                AttributeTypeEntity newEntity = new AttributeTypeEntity();
                if(base.ParticipatesInTransaction)
                {
                    base.Transaction.Add(newEntity);
                }
                bool fetchResult = false;
                if(performLazyLoading)
                {
                    fetchResult = newEntity.FetchUsingPK(this.AttributeTypeId);
                }
                if(fetchResult)
                {
                    if(base.ActiveContext!=null)
                    {
                        newEntity = (AttributeTypeEntity)base.ActiveContext.Get(newEntity);
                    }
                    this.AttributeType = newEntity;
                }
                else
                {
                    if(_attributeTypeReturnsNewIfNotFound)
                    {
                        if(performLazyLoading || (!performLazyLoading && (_attributeType == null)))
                        {
                            this.AttributeType = newEntity;
                        }
                    }
                    else
                    {
                        this.AttributeType = null;
                    }
                }
                _alreadyFetchedAttributeType = fetchResult;
                if(base.ParticipatesInTransaction && !fetchResult)
                {
                    base.Transaction.Remove(newEntity);
                }
            }
            return _attributeType;
        }
コード例 #5
0
        /// <summary>Private CTor for deserialization</summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected AttributeEntity(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _attributeValue = (policyDB.CollectionClasses.AttributeValueCollection)info.GetValue("_attributeValue", typeof(policyDB.CollectionClasses.AttributeValueCollection));
            _alwaysFetchAttributeValue = info.GetBoolean("_alwaysFetchAttributeValue");
            _alreadyFetchedAttributeValue = info.GetBoolean("_alreadyFetchedAttributeValue");
            _decisionNode = (policyDB.CollectionClasses.DecisionNodeCollection)info.GetValue("_decisionNode", typeof(policyDB.CollectionClasses.DecisionNodeCollection));
            _alwaysFetchDecisionNode = info.GetBoolean("_alwaysFetchDecisionNode");
            _alreadyFetchedDecisionNode = info.GetBoolean("_alreadyFetchedDecisionNode");
            _queryValue = (policyDB.CollectionClasses.QueryValueCollection)info.GetValue("_queryValue", typeof(policyDB.CollectionClasses.QueryValueCollection));
            _alwaysFetchQueryValue = info.GetBoolean("_alwaysFetchQueryValue");
            _alreadyFetchedQueryValue = info.GetBoolean("_alreadyFetchedQueryValue");
            _decisionNodeCollectionViaDecisionNode = (policyDB.CollectionClasses.DecisionNodeCollection)info.GetValue("_decisionNodeCollectionViaDecisionNode", typeof(policyDB.CollectionClasses.DecisionNodeCollection));
            _alwaysFetchDecisionNodeCollectionViaDecisionNode = info.GetBoolean("_alwaysFetchDecisionNodeCollectionViaDecisionNode");
            _alreadyFetchedDecisionNodeCollectionViaDecisionNode = info.GetBoolean("_alreadyFetchedDecisionNodeCollectionViaDecisionNode");
            _decisionNodeCollectionViaAttributeValue = (policyDB.CollectionClasses.DecisionNodeCollection)info.GetValue("_decisionNodeCollectionViaAttributeValue", typeof(policyDB.CollectionClasses.DecisionNodeCollection));
            _alwaysFetchDecisionNodeCollectionViaAttributeValue = info.GetBoolean("_alwaysFetchDecisionNodeCollectionViaAttributeValue");
            _alreadyFetchedDecisionNodeCollectionViaAttributeValue = info.GetBoolean("_alreadyFetchedDecisionNodeCollectionViaAttributeValue");
            _queryCollectionViaQueryValue = (policyDB.CollectionClasses.QueryCollection)info.GetValue("_queryCollectionViaQueryValue", typeof(policyDB.CollectionClasses.QueryCollection));
            _alwaysFetchQueryCollectionViaQueryValue = info.GetBoolean("_alwaysFetchQueryCollectionViaQueryValue");
            _alreadyFetchedQueryCollectionViaQueryValue = info.GetBoolean("_alreadyFetchedQueryCollectionViaQueryValue");
            _attributeType = (AttributeTypeEntity)info.GetValue("_attributeType", typeof(AttributeTypeEntity));
            if(_attributeType!=null)
            {
                _attributeType.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _attributeTypeReturnsNewIfNotFound = info.GetBoolean("_attributeTypeReturnsNewIfNotFound");
            _alwaysFetchAttributeType = info.GetBoolean("_alwaysFetchAttributeType");
            _alreadyFetchedAttributeType = info.GetBoolean("_alreadyFetchedAttributeType");
            _context = (ContextEntity)info.GetValue("_context", typeof(ContextEntity));
            if(_context!=null)
            {
                _context.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _contextReturnsNewIfNotFound = info.GetBoolean("_contextReturnsNewIfNotFound");
            _alwaysFetchContext = info.GetBoolean("_alwaysFetchContext");
            _alreadyFetchedContext = info.GetBoolean("_alreadyFetchedContext");

            base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance());

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
コード例 #6
0
 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 public override RelationCollection GetRelationsForFieldOfType(string fieldName)
 {
     return(AttributeTypeEntity.GetRelationsForField(fieldName));
 }
コード例 #7
0
        /// <summary>Creates a new, empty AttributeTypeEntity object.</summary>
        /// <returns>A new, empty AttributeTypeEntity object.</returns>
        public override IEntity Create()
        {
            IEntity toReturn = new AttributeTypeEntity();

            // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAttributeType
            // __LLBLGENPRO_USER_CODE_REGION_END
            return toReturn;
        }