The SqlStringBuilder is used to construct a SqlString.

Namespace:  NHibernate.SqlCommand
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
Public Class SqlStringBuilder _
	Implements ISqlStringBuilder
C#
public class SqlStringBuilder : ISqlStringBuilder
Visual C++
public ref class SqlStringBuilder : ISqlStringBuilder
JavaScript
NHibernate.SqlCommand.SqlStringBuilder = function();

Type.createClass(
	'NHibernate.SqlCommand.SqlStringBuilder',
	null,
	NHibernate.SqlCommand.ISqlStringBuilder);

Remarks

The SqlString is a nonmutable class so it can't have sql parts added to it. Instead this class should be used to generate a new SqlString. The SqlStringBuilder is to SqlString what the StringBuilder is to a String.

This is different from the original version of SqlString because this does not hold the sql string in the form of "column1=@column1" instead it uses an array to build the sql statement such that object[0] = "column1=" object[1] = ref to column1 parameter

What this allows us to do is to delay the generating of the parameter for the sql until the very end - making testing dialect indifferent. Right now all of our test to make sure the correct sql is getting built are specific to MsSql2000Dialect.

Inheritance Hierarchy

System..::.Object
  NHibernate.SqlCommand..::.SqlStringBuilder

See Also