/// <summary> Initializes the class members</summary>
        private void InitClassMembers()
        {
            _policyLink = new policyDB.CollectionClasses.PolicyLinkCollection(new PolicyLinkEntityFactory());
            _policyLink.SetContainingEntityInfo(this, "Policy");
            _alwaysFetchPolicyLink = false;
            _alreadyFetchedPolicyLink = false;
            _rule = new policyDB.CollectionClasses.RuleCollection(new RuleEntityFactory());
            _rule.SetContainingEntityInfo(this, "Policy");
            _alwaysFetchRule = false;
            _alreadyFetchedRule = false;
            _decisionNodeCollectionViaRule = new policyDB.CollectionClasses.DecisionNodeCollection(new DecisionNodeEntityFactory());
            _alwaysFetchDecisionNodeCollectionViaRule = false;
            _alreadyFetchedDecisionNodeCollectionViaRule = false;
            _effectCollectionViaRule = new policyDB.CollectionClasses.EffectCollection(new EffectEntityFactory());
            _alwaysFetchEffectCollectionViaRule = false;
            _alreadyFetchedEffectCollectionViaRule = false;
            _policyLinkCollectionViaPolicyLink = new policyDB.CollectionClasses.PolicyLinkCollection(new PolicyLinkEntityFactory());
            _alwaysFetchPolicyLinkCollectionViaPolicyLink = false;
            _alreadyFetchedPolicyLinkCollectionViaPolicyLink = false;
            _combineMode = null;
            _combineModeReturnsNewIfNotFound = true;
            _alwaysFetchCombineMode = false;
            _alreadyFetchedCombineMode = false;
            _library = null;
            _libraryReturnsNewIfNotFound = true;
            _alwaysFetchLibrary = false;
            _alreadyFetchedLibrary = false;
            _target = null;
            _targetReturnsNewIfNotFound = true;
            _alwaysFetchTarget = false;
            _alreadyFetchedTarget = false;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
        /// <summary>Private CTor for deserialization</summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected PolicyEntity(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _policyLink = (policyDB.CollectionClasses.PolicyLinkCollection)info.GetValue("_policyLink", typeof(policyDB.CollectionClasses.PolicyLinkCollection));
            _alwaysFetchPolicyLink = info.GetBoolean("_alwaysFetchPolicyLink");
            _alreadyFetchedPolicyLink = info.GetBoolean("_alreadyFetchedPolicyLink");
            _rule = (policyDB.CollectionClasses.RuleCollection)info.GetValue("_rule", typeof(policyDB.CollectionClasses.RuleCollection));
            _alwaysFetchRule = info.GetBoolean("_alwaysFetchRule");
            _alreadyFetchedRule = info.GetBoolean("_alreadyFetchedRule");
            _decisionNodeCollectionViaRule = (policyDB.CollectionClasses.DecisionNodeCollection)info.GetValue("_decisionNodeCollectionViaRule", typeof(policyDB.CollectionClasses.DecisionNodeCollection));
            _alwaysFetchDecisionNodeCollectionViaRule = info.GetBoolean("_alwaysFetchDecisionNodeCollectionViaRule");
            _alreadyFetchedDecisionNodeCollectionViaRule = info.GetBoolean("_alreadyFetchedDecisionNodeCollectionViaRule");
            _effectCollectionViaRule = (policyDB.CollectionClasses.EffectCollection)info.GetValue("_effectCollectionViaRule", typeof(policyDB.CollectionClasses.EffectCollection));
            _alwaysFetchEffectCollectionViaRule = info.GetBoolean("_alwaysFetchEffectCollectionViaRule");
            _alreadyFetchedEffectCollectionViaRule = info.GetBoolean("_alreadyFetchedEffectCollectionViaRule");
            _policyLinkCollectionViaPolicyLink = (policyDB.CollectionClasses.PolicyLinkCollection)info.GetValue("_policyLinkCollectionViaPolicyLink", typeof(policyDB.CollectionClasses.PolicyLinkCollection));
            _alwaysFetchPolicyLinkCollectionViaPolicyLink = info.GetBoolean("_alwaysFetchPolicyLinkCollectionViaPolicyLink");
            _alreadyFetchedPolicyLinkCollectionViaPolicyLink = info.GetBoolean("_alreadyFetchedPolicyLinkCollectionViaPolicyLink");
            _combineMode = (CombineModeEntity)info.GetValue("_combineMode", typeof(CombineModeEntity));
            if(_combineMode!=null)
            {
                _combineMode.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _combineModeReturnsNewIfNotFound = info.GetBoolean("_combineModeReturnsNewIfNotFound");
            _alwaysFetchCombineMode = info.GetBoolean("_alwaysFetchCombineMode");
            _alreadyFetchedCombineMode = info.GetBoolean("_alreadyFetchedCombineMode");
            _library = (LibraryEntity)info.GetValue("_library", typeof(LibraryEntity));
            if(_library!=null)
            {
                _library.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _libraryReturnsNewIfNotFound = info.GetBoolean("_libraryReturnsNewIfNotFound");
            _alwaysFetchLibrary = info.GetBoolean("_alwaysFetchLibrary");
            _alreadyFetchedLibrary = info.GetBoolean("_alreadyFetchedLibrary");
            _target = (TargetEntity)info.GetValue("_target", typeof(TargetEntity));
            if(_target!=null)
            {
                _target.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _targetReturnsNewIfNotFound = info.GetBoolean("_targetReturnsNewIfNotFound");
            _alwaysFetchTarget = info.GetBoolean("_alwaysFetchTarget");
            _alreadyFetchedTarget = info.GetBoolean("_alreadyFetchedTarget");

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

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
        /// <summary> Initializes the class members</summary>
        private void InitClassMembers()
        {
            _policy = new policyDB.CollectionClasses.PolicyCollection(new PolicyEntityFactory());
            _policy.SetContainingEntityInfo(this, "Library");
            _alwaysFetchPolicy = false;
            _alreadyFetchedPolicy = false;
            _policyDocument = new policyDB.CollectionClasses.PolicyDocumentCollection(new PolicyDocumentEntityFactory());
            _policyDocument.SetContainingEntityInfo(this, "Library");
            _alwaysFetchPolicyDocument = false;
            _alreadyFetchedPolicyDocument = false;
            _query = new policyDB.CollectionClasses.QueryCollection(new QueryEntityFactory());
            _query.SetContainingEntityInfo(this, "Library");
            _alwaysFetchQuery = false;
            _alreadyFetchedQuery = false;
            _combineModeCollectionViaPolicy = new policyDB.CollectionClasses.CombineModeCollection(new CombineModeEntityFactory());
            _alwaysFetchCombineModeCollectionViaPolicy = false;
            _alreadyFetchedCombineModeCollectionViaPolicy = false;
            _policyLinkCollectionViaPolicyDocument = new policyDB.CollectionClasses.PolicyLinkCollection(new PolicyLinkEntityFactory());
            _alwaysFetchPolicyLinkCollectionViaPolicyDocument = false;
            _alreadyFetchedPolicyLinkCollectionViaPolicyDocument = false;
            _targetCollectionViaPolicy = new policyDB.CollectionClasses.TargetCollection(new TargetEntityFactory());
            _alwaysFetchTargetCollectionViaPolicy = false;
            _alreadyFetchedTargetCollectionViaPolicy = false;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
        /// <summary>Private CTor for deserialization</summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected LibraryEntity(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _policy = (policyDB.CollectionClasses.PolicyCollection)info.GetValue("_policy", typeof(policyDB.CollectionClasses.PolicyCollection));
            _alwaysFetchPolicy = info.GetBoolean("_alwaysFetchPolicy");
            _alreadyFetchedPolicy = info.GetBoolean("_alreadyFetchedPolicy");
            _policyDocument = (policyDB.CollectionClasses.PolicyDocumentCollection)info.GetValue("_policyDocument", typeof(policyDB.CollectionClasses.PolicyDocumentCollection));
            _alwaysFetchPolicyDocument = info.GetBoolean("_alwaysFetchPolicyDocument");
            _alreadyFetchedPolicyDocument = info.GetBoolean("_alreadyFetchedPolicyDocument");
            _query = (policyDB.CollectionClasses.QueryCollection)info.GetValue("_query", typeof(policyDB.CollectionClasses.QueryCollection));
            _alwaysFetchQuery = info.GetBoolean("_alwaysFetchQuery");
            _alreadyFetchedQuery = info.GetBoolean("_alreadyFetchedQuery");
            _combineModeCollectionViaPolicy = (policyDB.CollectionClasses.CombineModeCollection)info.GetValue("_combineModeCollectionViaPolicy", typeof(policyDB.CollectionClasses.CombineModeCollection));
            _alwaysFetchCombineModeCollectionViaPolicy = info.GetBoolean("_alwaysFetchCombineModeCollectionViaPolicy");
            _alreadyFetchedCombineModeCollectionViaPolicy = info.GetBoolean("_alreadyFetchedCombineModeCollectionViaPolicy");
            _policyLinkCollectionViaPolicyDocument = (policyDB.CollectionClasses.PolicyLinkCollection)info.GetValue("_policyLinkCollectionViaPolicyDocument", typeof(policyDB.CollectionClasses.PolicyLinkCollection));
            _alwaysFetchPolicyLinkCollectionViaPolicyDocument = info.GetBoolean("_alwaysFetchPolicyLinkCollectionViaPolicyDocument");
            _alreadyFetchedPolicyLinkCollectionViaPolicyDocument = info.GetBoolean("_alreadyFetchedPolicyLinkCollectionViaPolicyDocument");
            _targetCollectionViaPolicy = (policyDB.CollectionClasses.TargetCollection)info.GetValue("_targetCollectionViaPolicy", typeof(policyDB.CollectionClasses.TargetCollection));
            _alwaysFetchTargetCollectionViaPolicy = info.GetBoolean("_alwaysFetchTargetCollectionViaPolicy");
            _alreadyFetchedTargetCollectionViaPolicy = info.GetBoolean("_alreadyFetchedTargetCollectionViaPolicy");

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

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
        /// <summary> Initializes the class members</summary>
        private void InitClassMembers()
        {
            _policyDocument = new policyDB.CollectionClasses.PolicyDocumentCollection(new PolicyDocumentEntityFactory());
            _policyDocument.SetContainingEntityInfo(this, "PolicyLink");
            _alwaysFetchPolicyDocument = false;
            _alreadyFetchedPolicyDocument = false;
            _children = new policyDB.CollectionClasses.PolicyLinkCollection(new PolicyLinkEntityFactory());
            _children.SetContainingEntityInfo(this, "Parent");
            _alwaysFetchChildren = false;
            _alreadyFetchedChildren = false;
            _libraryCollectionViaPolicyDocument = new policyDB.CollectionClasses.LibraryCollection(new LibraryEntityFactory());
            _alwaysFetchLibraryCollectionViaPolicyDocument = false;
            _alreadyFetchedLibraryCollectionViaPolicyDocument = false;
            _policyCollectionViaPolicyLink = new policyDB.CollectionClasses.PolicyCollection(new PolicyEntityFactory());
            _alwaysFetchPolicyCollectionViaPolicyLink = false;
            _alreadyFetchedPolicyCollectionViaPolicyLink = false;
            _policy = null;
            _policyReturnsNewIfNotFound = true;
            _alwaysFetchPolicy = false;
            _alreadyFetchedPolicy = false;
            _parent = null;
            _parentReturnsNewIfNotFound = true;
            _alwaysFetchParent = false;
            _alreadyFetchedParent = false;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
        /// <summary>Private CTor for deserialization</summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected PolicyLinkEntity(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            _policyDocument = (policyDB.CollectionClasses.PolicyDocumentCollection)info.GetValue("_policyDocument", typeof(policyDB.CollectionClasses.PolicyDocumentCollection));
            _alwaysFetchPolicyDocument = info.GetBoolean("_alwaysFetchPolicyDocument");
            _alreadyFetchedPolicyDocument = info.GetBoolean("_alreadyFetchedPolicyDocument");
            _children = (policyDB.CollectionClasses.PolicyLinkCollection)info.GetValue("_children", typeof(policyDB.CollectionClasses.PolicyLinkCollection));
            _alwaysFetchChildren = info.GetBoolean("_alwaysFetchChildren");
            _alreadyFetchedChildren = info.GetBoolean("_alreadyFetchedChildren");
            _libraryCollectionViaPolicyDocument = (policyDB.CollectionClasses.LibraryCollection)info.GetValue("_libraryCollectionViaPolicyDocument", typeof(policyDB.CollectionClasses.LibraryCollection));
            _alwaysFetchLibraryCollectionViaPolicyDocument = info.GetBoolean("_alwaysFetchLibraryCollectionViaPolicyDocument");
            _alreadyFetchedLibraryCollectionViaPolicyDocument = info.GetBoolean("_alreadyFetchedLibraryCollectionViaPolicyDocument");
            _policyCollectionViaPolicyLink = (policyDB.CollectionClasses.PolicyCollection)info.GetValue("_policyCollectionViaPolicyLink", typeof(policyDB.CollectionClasses.PolicyCollection));
            _alwaysFetchPolicyCollectionViaPolicyLink = info.GetBoolean("_alwaysFetchPolicyCollectionViaPolicyLink");
            _alreadyFetchedPolicyCollectionViaPolicyLink = info.GetBoolean("_alreadyFetchedPolicyCollectionViaPolicyLink");
            _policy = (PolicyEntity)info.GetValue("_policy", typeof(PolicyEntity));
            if(_policy!=null)
            {
                _policy.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _policyReturnsNewIfNotFound = info.GetBoolean("_policyReturnsNewIfNotFound");
            _alwaysFetchPolicy = info.GetBoolean("_alwaysFetchPolicy");
            _alreadyFetchedPolicy = info.GetBoolean("_alreadyFetchedPolicy");
            _parent = (PolicyLinkEntity)info.GetValue("_parent", typeof(PolicyLinkEntity));
            if(_parent!=null)
            {
                _parent.AfterSave+=new EventHandler(OnEntityAfterSave);
            }
            _parentReturnsNewIfNotFound = info.GetBoolean("_parentReturnsNewIfNotFound");
            _alwaysFetchParent = info.GetBoolean("_alwaysFetchParent");
            _alreadyFetchedParent = info.GetBoolean("_alreadyFetchedParent");

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

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }