コード例 #1
0
ファイル: ObjectExpression.cs プロジェクト: Marceli/Roberta
 internal ObjectExpression(Type objectType, Expression expression, Mappings maps, int parameterCount)
 {
     _objectType = objectType;
     _expression = expression;
     _maps = maps;
     _parameterCount = parameterCount;
 }
コード例 #2
0
		public void Compile(ObjectExpression oe)
		{
			_maps = oe.Mappings;
			_provider = oe.Mappings.provider;

			_nextAliasIndex = 0;
			_parameterTable = new OPathParameterTable();

			// generate the database-specific query statement (and the parameter table at the same time)
			using( StringWriter writer = new StringWriter(new StringBuilder(500)) )
			{
				WriteSqlQuery(writer, oe.Expression);
				writer.Write(_provider.LineTerminator);
				_sqlQuery = writer.ToString();
			}

			SetParameterOrder(oe);

			// all or none of the parameters have to be provided
			if( _parameterTable != null )
			{
				if( _parameterTable.Count != oe.ParameterCount )
				{
					throw new Exception("Number of parameters in the expression does not match number of parameters in the OPathQuery.");
				}
			}

#if DEBUG
			//Debug.WriteLine(_sqlQuery);
			//Debug.WriteLine("");
#endif
		}
コード例 #3
0
ファイル: OPath.cs プロジェクト: cnporras/wilsonormapper
		internal static ObjectExpression Parse(OPathQuery query, Mappings maps)
		{
			OPath opath = new OPath(maps);

			int paramCount;
			Expression exp = opath.Parse(query.ObjectType, query.WhereExpression, query.SortExpression, out paramCount);
			ObjectExpression oe = new ObjectExpression(query.ObjectType, exp, maps, paramCount);
			oe.baseQuery = query;

			return oe;
		}
コード例 #4
0
ファイル: OPath.cs プロジェクト: cnporras/wilsonormapper
		internal OPath(Mappings maps)
		{
			_maps = maps;
		}
コード例 #5
0
ファイル: QueryHelper.cs プロジェクト: Marceli/Roberta
 internal QueryHelper(Mappings mappings)
 {
     this.mappings = mappings;
 }
コード例 #6
0
ファイル: ObjectExpression.cs プロジェクト: Marceli/Roberta
 /// <summary>
 /// Compiles this ObjectExpression using the mappings found the specified ObjectSpace instance.
 /// </summary>
 /// <param name="os">ObjectSpace instance to use.</param>
 /// <returns>A CompiledQuery that is the result of this instance being compiled.</returns>
 public CompiledQuery Compile(ObjectSpace os)
 {
     if( os == null ) throw new ArgumentNullException("os");
     _maps = os.context.Mappings;
     return new CompiledQuery(this);
 }
コード例 #7
0
ファイル: OPathSortParser.cs プロジェクト: Marceli/Roberta
 public OPathSortParser(Mappings maps)
 {
     _maps = maps;
 }