JoinSequence

Namespace: NHibernate
We found 10 examples in language CSharp for this search. You will see 47 fragments of code.

		public JoinSequence GetFromPart()
		{
			JoinSequence fromPart = new JoinSequence(factory);
			fromPart.joins.AddRange(this.joins);
			fromPart.useThetaStyle = this.useThetaStyle;
			fromPart.rootAlias = this.rootAlias;
			fromPart.rootJoinable = this.rootJoinable;
			fromPart.selector = this.selector;
			fromPart.next = this.next == null ? null : this.next.GetFromPart();
			fromPart.isFromPart = true;
			return fromPart;
		}

		public JoinSequence Copy()
		{
			JoinSequence copy = new JoinSequence(factory);
			copy.joins.AddRange(this.joins);
			copy.useThetaStyle = this.useThetaStyle;
			copy.rootAlias = this.rootAlias;
			copy.rootJoinable = this.rootJoinable;
			copy.selector = this.selector;
			copy.next = this.next == null ? null : this.next.Copy();
			copy.isFromPart = this.isFromPart;
			copy.conditions.Add(this.conditions.ToSqlString());
			return copy;
		}

		public JoinSequence AddJoin(IAssociationType associationType, string alias, JoinType joinType, string[] referencingKey)
		{
			joins.Add(new Join(factory, associationType, alias, joinType, referencingKey));
			return this;
		}

		public JoinSequence AddCondition(SqlString condition)
		{
			if (condition.Trim().Length != 0)
			{
				if (!condition.StartsWithCaseInsensitive(" and "))
					conditions.Add(" and ");
				conditions.Add(condition);
			}
			return this;
		}

		public JoinSequence AddCondition(string alias, string[] columns, string condition, bool appendParameter)
		{
			for (int i = 0; i < columns.Length; i++)
			{
				conditions.Add(" and ")
					.Add(alias)
					.Add(".")
					.Add(columns[i])
					.Add(condition);
				if (appendParameter)
				{
					conditions.AddParameter();
				}
			}
			return this;
		}

		public JoinSequence SetRoot(IJoinable joinable, string alias)
		{
			this.rootAlias = alias;
			this.rootJoinable = joinable;
			return this;
		}


		private void AddJoin(string name, IAssociationType joinableType, string[] foreignKeyColumns)
		{
			try
			{
				joinSequence.AddJoin(joinableType, name, joinType, foreignKeyColumns);
			}
			catch (MappingException me)
			{
				throw new QueryException(me);
			}
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="q"></param>
		public void Start(QueryTranslator q)
		{
			if (!continuation)
			{
				Reset(q);
				path.Length = 0;
				joinSequence = new JoinSequence(q.Factory).SetUseThetaStyle(useThetaStyleJoin);
			}
		}

		/// <summary></summary>
		public string GetCollectionSubquery(IDictionary enabledFilters)
		{
			return CollectionSubqueryFactory.CreateCollectionSubquery(
				joinSequence, enabledFilters, CurrentColumns());
		}


		/// <summary>
		/// 
		/// </summary>
		/// <param name="q"></param>
		public void AddAssociation(QueryTranslator q)
		{
			q.AddJoin(Name, joinSequence);
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="q"></param>
		/// <returns></returns>
		public string AddFromAssociation(QueryTranslator q)
		{
			if (IsCollectionValued)
			{
				return AddFromCollection(q);
			}
			else
			{
				q.AddFrom(currentName, joinSequence);
				return currentName;
			}
		}


		public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection,
																						 String collectionName)
		{
			JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName);
			_queryableCollection = queryableCollection;
			return CreateCollectionJoin(collectionJoinSequence, null);
		}


		private JoinSequence CreateJoinSequence(string roleAlias, JoinType joinType)
		{
			SessionFactoryHelperExtensions sessionFactoryHelper = _fromClause.SessionFactoryHelper;
			string[] joinColumns = Columns;
			if (_collectionType == null)
			{
				throw new InvalidOperationException("collectionType is null!");
			}
			return sessionFactoryHelper.CreateJoinSequence(_implied, _collectionType, roleAlias, joinType, joinColumns);
		}

		private FromElement InitializeJoin(
						string path,
						FromElement destination,
						JoinSequence joinSequence,
						string[] columns,
						FromElement origin,
						bool manyToMany)
		{
			destination.Type = HqlSqlWalker.JOIN_FRAGMENT;
			destination.JoinSequence = joinSequence;
			destination.Columns = columns;
			destination.SetOrigin(origin, manyToMany);
			_fromClause.AddJoinByPathMap(path, destination);
			return destination;
		}


		public JoinSequence GetFromPart()
		{
			JoinSequence fromPart = new JoinSequence(factory);
			fromPart.joins.AddRange(this.joins);
			fromPart.useThetaStyle = this.useThetaStyle;
			fromPart.rootAlias = this.rootAlias;
			fromPart.rootJoinable = this.rootJoinable;
			fromPart.selector = this.selector;
			fromPart.next = this.next == null ? null : this.next.GetFromPart();
			fromPart.isFromPart = true;
			return fromPart;
		}

		public JoinSequence Copy()
		{
			JoinSequence copy = new JoinSequence(factory);
			copy.joins.AddRange(this.joins);
			copy.useThetaStyle = this.useThetaStyle;
			copy.rootAlias = this.rootAlias;
			copy.rootJoinable = this.rootJoinable;
			copy.selector = this.selector;
			copy.next = this.next == null ? null : this.next.Copy();
			copy.isFromPart = this.isFromPart;
			copy.conditions.Add(this.conditions.ToSqlString());
			return copy;
		}

		public JoinSequence AddJoin(IAssociationType associationType, string alias, JoinType joinType, string[] referencingKey)
		{
			joins.Add(new Join(factory, associationType, alias, joinType, referencingKey));
			return this;
		}

		public JoinSequence AddCondition(SqlString condition)
		{
			if (condition.Trim().Length != 0)
			{
				if (!condition.StartsWithCaseInsensitive(" and "))
					conditions.Add(" and ");
				conditions.Add(condition);
			}
			return this;
		}

		public JoinSequence AddCondition(string alias, string[] columns, string condition, bool appendParameter)
		{
			for (int i = 0; i < columns.Length; i++)
			{
				conditions.Add(" and ")
					.Add(alias)
					.Add(".")
					.Add(columns[i])
					.Add(condition);
				if (appendParameter)
				{
					conditions.AddParameter();
				}
			}
			return this;
		}

		public JoinSequence SetRoot(IJoinable joinable, string alias)
		{
			this.rootAlias = alias;
			this.rootJoinable = joinable;
			return this;
		}


		internal void AddFrom(string name, System.Type type, JoinSequence joinSequence)
		{
			AddType(name, type);
			AddFrom(name, joinSequence);
		}

		internal void AddFromCollection(string name, string collectionRole, JoinSequence joinSequence)
		{
			//register collection role
			AddCollection(name, collectionRole);
			AddJoin(name, joinSequence);
		}

		internal void AddFrom(string name, JoinSequence joinSequence)
		{
			fromTypes.Add(name);
			AddJoin(name, joinSequence);
		}

		internal void AddFromClass(string name, IQueryable classPersister)
		{
			JoinSequence joinSequence = new JoinSequence(Factory)
				.SetRoot(classPersister, name);
			AddFrom(name, classPersister.MappedClass, joinSequence);
		}

		internal void AddJoin(string name, JoinSequence joinSequence)
		{
			if (!joins.Contains(name))
			{
				joins.Add(name, joinSequence);
			}
		}

		internal JoinSequence GetPathJoin(string path)
		{
			return (JoinSequence) pathJoins[path];
		}


		public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection,
																						 String collectionName)
		{
			JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName);
			_queryableCollection = queryableCollection;
			return CreateCollectionJoin(collectionJoinSequence, null);
		}


		private JoinSequence CreateJoinSequence(string roleAlias, JoinType joinType)
		{
			SessionFactoryHelperExtensions sessionFactoryHelper = _fromClause.SessionFactoryHelper;
			string[] joinColumns = Columns;
			if (_collectionType == null)
			{
				throw new InvalidOperationException("collectionType is null!");
			}
			return sessionFactoryHelper.CreateJoinSequence(_implied, _collectionType, roleAlias, joinType, joinColumns);
		}

		private FromElement InitializeJoin(
						string path,
						FromElement destination,
						JoinSequence joinSequence,
						string[] columns,
						FromElement origin,
						bool manyToMany)
		{
			destination.Type = HqlSqlWalker.JOIN_FRAGMENT;
			destination.JoinSequence = joinSequence;
			destination.Columns = columns;
			destination.SetOrigin(origin, manyToMany);
			_fromClause.AddJoinByPathMap(path, destination);
			return destination;
		}


		public JoinSequence GetFromPart()
		{
			JoinSequence fromPart = new JoinSequence(factory);
			fromPart.joins.AddRange(this.joins);
			fromPart.useThetaStyle = this.useThetaStyle;
			fromPart.rootAlias = this.rootAlias;
			fromPart.rootJoinable = this.rootJoinable;
			fromPart.selector = this.selector;
			fromPart.next = this.next == null ? null : this.next.GetFromPart();
			fromPart.isFromPart = true;
			return fromPart;
		}

		public JoinSequence Copy()
		{
			JoinSequence copy = new JoinSequence(factory);
			copy.joins.AddRange(this.joins);
			copy.useThetaStyle = this.useThetaStyle;
			copy.rootAlias = this.rootAlias;
			copy.rootJoinable = this.rootJoinable;
			copy.selector = this.selector;
			copy.next = this.next == null ? null : this.next.Copy();
			copy.isFromPart = this.isFromPart;
			copy.conditions.Add(this.conditions.ToSqlString());
			return copy;
		}

		public JoinSequence AddJoin(IAssociationType associationType, string alias, JoinType joinType, string[] referencingKey)
		{
			joins.Add(new Join(factory, associationType, alias, joinType, referencingKey));
			return this;
		}

		public JoinSequence AddCondition(SqlString condition)
		{
			if (condition.Trim().Length != 0)
			{
				if (!condition.StartsWithCaseInsensitive(" and "))
					conditions.Add(" and ");
				conditions.Add(condition);
			}
			return this;
		}

		public JoinSequence AddCondition(string alias, string[] columns, string condition, bool appendParameter)
		{
			for (int i = 0; i < columns.Length; i++)
			{
				conditions.Add(" and ")
					.Add(alias)
					.Add(".")
					.Add(columns[i])
					.Add(condition);
				if (appendParameter)
				{
					conditions.AddParameter();
				}
			}
			return this;
		}

		public JoinSequence SetRoot(IJoinable joinable, string alias)
		{
			this.rootAlias = alias;
			this.rootJoinable = joinable;
			return this;
		}


		public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection,
																						 String collectionName)
		{
			JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName);
			_queryableCollection = queryableCollection;
			return CreateCollectionJoin(collectionJoinSequence, null);
		}


		private JoinSequence CreateJoinSequence(string roleAlias, JoinType joinType)
		{
			SessionFactoryHelperExtensions sessionFactoryHelper = _fromClause.SessionFactoryHelper;
			string[] joinColumns = Columns;
			if (_collectionType == null)
			{
				throw new InvalidOperationException("collectionType is null!");
			}
			return sessionFactoryHelper.CreateJoinSequence(_implied, _collectionType, roleAlias, joinType, joinColumns);
		}

		private FromElement InitializeJoin(
						string path,
						FromElement destination,
						JoinSequence joinSequence,
						string[] columns,
						FromElement origin,
						bool manyToMany)
		{
			destination.Type = HqlSqlWalker.JOIN_FRAGMENT;
			destination.JoinSequence = joinSequence;
			destination.Columns = columns;
			destination.SetOrigin(origin, manyToMany);
			_fromClause.AddJoinByPathMap(path, destination);
			return destination;
		}


		public FromElement CreateCollectionElementsJoin(IQueryableCollection queryableCollection,
																						 String collectionName)
		{
			JoinSequence collectionJoinSequence = _fromClause.SessionFactoryHelper.CreateCollectionJoinSequence(queryableCollection, collectionName);
			_queryableCollection = queryableCollection;
			return CreateCollectionJoin(collectionJoinSequence, null);
		}


		private JoinSequence CreateJoinSequence(string roleAlias, JoinType joinType)
		{
			SessionFactoryHelperExtensions sessionFactoryHelper = _fromClause.SessionFactoryHelper;
			string[] joinColumns = Columns;
			if (_collectionType == null)
			{
				throw new InvalidOperationException("collectionType is null!");
			}
			return sessionFactoryHelper.CreateJoinSequence(_implied, _collectionType, roleAlias, joinType, joinColumns);
		}

		private FromElement InitializeJoin(
						string path,
						FromElement destination,
						JoinSequence joinSequence,
						string[] columns,
						FromElement origin,
						bool manyToMany)
		{
			destination.Type = HqlSqlWalker.JOIN_FRAGMENT;
			destination.JoinSequence = joinSequence;
			destination.Columns = columns;
			destination.SetOrigin(origin, manyToMany);
			_fromClause.AddJoinByPathMap(path, destination);
			return destination;
		}


		public JoinSequence GetFromPart()
		{
			JoinSequence fromPart = new JoinSequence(factory);
			fromPart.joins.AddRange(this.joins);
			fromPart.useThetaStyle = this.useThetaStyle;
			fromPart.rootAlias = this.rootAlias;
			fromPart.rootJoinable = this.rootJoinable;
			fromPart.selector = this.selector;
			fromPart.next = this.next == null ? null : this.next.GetFromPart();
			fromPart.isFromPart = true;
			return fromPart;
		}

		public JoinSequence Copy()
		{
			JoinSequence copy = new JoinSequence(factory);
			copy.joins.AddRange(this.joins);
			copy.useThetaStyle = this.useThetaStyle;
			copy.rootAlias = this.rootAlias;
			copy.rootJoinable = this.rootJoinable;
			copy.selector = this.selector;
			copy.next = this.next == null ? null : this.next.Copy();
			copy.isFromPart = this.isFromPart;
			copy.conditions.Add(this.conditions.ToSqlString());
			return copy;
		}

		public JoinSequence AddJoin(IAssociationType associationType, string alias, JoinType joinType, string[] referencingKey)
		{
			joins.Add(new Join(factory, associationType, alias, joinType, referencingKey));
			return this;
		}

		public JoinSequence AddCondition(SqlString condition)
		{
			if (condition.Trim().Length != 0)
			{
				if (!condition.StartsWithCaseInsensitive(" and "))
					conditions.Add(" and ");
				conditions.Add(condition);
			}
			return this;
		}

		public JoinSequence AddCondition(string alias, string[] columns, string condition, bool appendParameter)
		{
			for (int i = 0; i < columns.Length; i++)
			{
				conditions.Add(" and ")
					.Add(alias)
					.Add(".")
					.Add(columns[i])
					.Add(condition);
				if (appendParameter)
				{
					conditions.AddParameter();
				}
			}
			return this;
		}

		public JoinSequence SetRoot(IJoinable joinable, string alias)
		{
			this.rootAlias = alias;
			this.rootJoinable = joinable;
			return this;
		}

NHibernate.Engine.JoinSequence : Object

Constructors :

public JoinSequence(ISessionFactoryImplementor factory = )

Methods :

public String ToString()
public JoinSequence GetFromPart()
public JoinSequence Copy()
public JoinSequence AddJoin(IAssociationType associationType = , String alias = , JoinType joinType = , String[] referencingKey = )
public JoinFragment ToJoinFragment()
public JoinFragment ToJoinFragment(IDictionary<String, IFilter> enabledFilters = , Boolean includeExtraJoins = )
public JoinFragment ToJoinFragment(IDictionary<String, IFilter> enabledFilters = , Boolean includeExtraJoins = , SqlString withClauseFragment = , String withClauseJoinAlias = )
public JoinSequence AddCondition(SqlString condition = )
public JoinSequence AddCondition(String alias = , String[] columns = , String condition = , Boolean appendParameter = )
public JoinSequence SetRoot(IJoinable joinable = , String alias = )
public JoinSequence SetNext(JoinSequence next = )
public JoinSequence SetSelector(ISelector s = )
public JoinSequence SetUseThetaStyle(Boolean useThetaStyle = )
public Boolean get_IsThetaStyle()
public Int32 get_JoinCount()
public ISessionFactoryImplementor get_Factory()
public Type GetType()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()