Example #1
0
        /// <summary>
        /// For an entity class, add to a list of associations to be fetched by outerjoin
        /// </summary>
        /// <param name="persister"></param>
        /// <param name="alias"></param>
        /// <param name="associations"></param>
        /// <param name="visitedPersisters"></param>
        /// <param name="path"></param>
        /// <param name="currentDepth"></param>
        /// <param name="factory"></param>
        private void WalkClassTree(
            IOuterJoinLoadable persister,
            string alias,
            IList associations,
            ISet visitedPersisters,
            string path,
            int currentDepth,
            ISessionFactoryImplementor factory)
        {
            int n = persister.CountSubclassProperties();

            for (int i = 0; i < n; i++)
            {
                IType type = persister.GetSubclassPropertyType(i);
                if (type.IsAssociationType)
                {
                    WalkAssociationTree(
                        ( IAssociationType )type,
                        persister,
                        i,
                        alias,
                        associations,
                        visitedPersisters,
                        path,
                        currentDepth,
                        factory
                        );
                }
                else if (type.IsComponentType)
                {
                    WalkComponentTree(
                        ( IAbstractComponentType )type,
                        i,
                        persister.GetSubclassPropertyColumnNames(i),
                        persister.ToColumns(alias, i),
                        persister,
                        alias,
                        associations,
                        visitedPersisters,
                        SubPath(path, persister.GetSubclassPropertyName(i)),
                        currentDepth,
                        factory
                        );
                }
            }
        }
Example #2
0
        /// <summary>
        /// For an entity class, add to a list of associations to be fetched
        /// by outerjoin
        /// </summary>
        protected virtual void WalkEntityTree(IOuterJoinLoadable persister, string alias, string path, int currentDepth)
        {
            int n = persister.CountSubclassProperties();

            for (int i = 0; i < n; i++)
            {
                IType type = persister.GetSubclassPropertyType(i);
                ILhsAssociationTypeSqlInfo associationTypeSQLInfo = JoinHelper.GetLhsSqlInfo(alias, i, persister, Factory);
                if (type.IsAssociationType)
                {
                    WalkEntityAssociationTree((IAssociationType)type, persister, i, alias, path,
                                              persister.IsSubclassPropertyNullable(i), currentDepth, associationTypeSQLInfo);
                }
                else if (type.IsComponentType)
                {
                    WalkComponentTree((IAbstractComponentType)type, 0, alias, SubPath(path, persister.GetSubclassPropertyName(i)),
                                      currentDepth, associationTypeSQLInfo);
                }
            }
        }
Example #3
0
		/// <summary>
		/// For an entity class, add to a list of associations to be fetched
		/// by outerjoin
		/// </summary>
		protected virtual void WalkEntityTree(IOuterJoinLoadable persister, string alias, string path, int currentDepth)
		{
			int n = persister.CountSubclassProperties();
			for (int i = 0; i < n; i++)
			{
				IType type = persister.GetSubclassPropertyType(i);
				ILhsAssociationTypeSqlInfo associationTypeSQLInfo = JoinHelper.GetLhsSqlInfo(alias, i, persister, Factory);
				if (type.IsAssociationType)
				{
					WalkEntityAssociationTree((IAssociationType) type, persister, i, alias, path,
					                          persister.IsSubclassPropertyNullable(i), currentDepth, associationTypeSQLInfo);
				}
				else if (type.IsComponentType)
				{
					WalkComponentTree((IAbstractComponentType) type, 0, alias, SubPath(path, persister.GetSubclassPropertyName(i)),
					                  currentDepth, associationTypeSQLInfo);
				}
			}
		}
Example #4
0
		/// <summary>
		/// For an entity class, add to a list of associations to be fetched
		/// by outerjoin
		/// </summary>
		private void WalkEntityTree(IOuterJoinLoadable persister, string alias, string path, int currentDepth)
		{
			int n = persister.CountSubclassProperties();
			for (int i = 0; i < n; i++)
			{
				IType type = persister.GetSubclassPropertyType(i);
				if (type.IsAssociationType)
				{
					WalkEntityAssociationTree((IAssociationType)type, persister, i, alias, path,
																		persister.IsSubclassPropertyNullable(i), currentDepth);
				}
				else if (type.IsComponentType)
				{
					WalkComponentTree((IAbstractComponentType)type, i, 0, persister, alias,
														SubPath(path, persister.GetSubclassPropertyName(i)), currentDepth);
				}
			}
		}
		/// <summary>
		/// For an entity class, add to a list of associations to be fetched by outerjoin
		/// </summary>
		/// <param name="persister"></param>
		/// <param name="alias"></param>
		/// <param name="associations"></param>
		/// <param name="visitedPersisters"></param>
		/// <param name="path"></param>
		/// <param name="currentDepth"></param>
		/// <param name="factory"></param>
		private void WalkClassTree( 
			IOuterJoinLoadable persister, 
			string alias, 
			IList associations, 
			ISet visitedPersisters, 
			string path,
			int currentDepth,
			ISessionFactoryImplementor factory )
		{
			int n = persister.CountSubclassProperties();
			for( int i = 0; i < n; i++ )
			{
				IType type = persister.GetSubclassPropertyType( i );
				if( type.IsAssociationType )
				{
					WalkAssociationTree(
						( IAssociationType ) type,
						persister,
						i,
						alias,
						associations,
						visitedPersisters,
						path,
						currentDepth,
						factory
						);

				}
				else if( type.IsComponentType )
				{
					WalkComponentTree(
						( IAbstractComponentType ) type,
						i,
						persister.GetSubclassPropertyColumnNames( i ),
						persister.ToColumns( alias, i ),
						persister,
						alias,
						associations,
						visitedPersisters,
						SubPath( path, persister.GetSubclassPropertyName( i ) ),
						currentDepth,
						factory
						);
				}
			}
		}