frompathexpressionparser.cs

来自「NHibernate NET开发者所需的」· CS 代码 · 共 37 行

CS
37
字号
using NHibernate.Persister.Collection;
using NHibernate.Type;

namespace NHibernate.Hql.Classic
{
	/// <summary>
	/// FromPathExpressionParser
	/// </summary>
	public class FromPathExpressionParser : PathExpressionParser
	{
		public override void End(QueryTranslator q)
		{
			if (!IsCollectionValued)
			{
				IType type = PropertyType;
				if (type.IsEntityType)
				{
					// "finish off" the join
					Token(".", q);
					Token(null, q);
				}
				else if (type.IsCollectionType)
				{
					// default to element set if no elements() specified
					Token(".", q);
					Token(CollectionPropertyNames.Elements, q);
				}
			}
			base.End(q);
		}

		protected override void SetExpectingCollectionIndex()
		{
			throw new QueryException("illegal syntax near collection-valued path expression in from: " + CollectionName);
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?