예제 #1
0
		public void LogParameters(ISessionFactoryImplementor factory)
		{
			var print = new Printer(factory);
			if (PositionalParameterValues.Length != 0)
			{
				log.Debug("parameters: " + print.ToString(PositionalParameterTypes, PositionalParameterValues));
			}

			if (NamedParameters != null)
			{
				log.Debug("named parameters: " + print.ToString(NamedParameters));
			}
		}
예제 #2
0
		public override string ToString()
		{
			StringBuilder buf = new StringBuilder()
				.Append("sql: ")
				.Append(_sqlQueryString);

			Printer print = new Printer(_factory);

			if (_values != null)
			{
				buf
					.Append("; parameters: ")
					.Append(print.ToString(_types, _values));
			}
			if (_namedParameters != null)
			{
				buf
					.Append("; named parameters: ")
					.Append(print.ToString(_namedParameters));
			}
			if (_filters != null)
			{
				buf.Append("; filters: ").Append(CollectionPrinter.ToString(_filters));
			}
			if (_firstRow != RowSelection.NoValue)
			{
				buf.Append("; first row: ").Append(_firstRow);
			}
			if (_maxRows != RowSelection.NoValue)
			{
				buf.Append("; max rows: ").Append(_maxRows);
			}

			if (_multiQueriesFirstRows != null)
			{
				buf.Append("; multi queries - first rows: ");
				for (int i = 0; i < _multiQueriesFirstRows.Length; i++)
				{
					buf.Append("#").Append(i)
						.Append("=")
						.Append(_multiQueriesFirstRows[i]);
				}
				buf.Append("; ");
			}

			if (_multiQueriesMaxRows != null)
			{
				buf.Append("; multi queries - max rows: ");
				for (int i = 0; i < _multiQueriesMaxRows.Length; i++)
				{
					buf.Append("#").Append(i)
						.Append("=")
						.Append(_multiQueriesMaxRows[i]);
				}
				buf.Append("; ");
			}


			return buf.ToString();
		}