C# Класс Habanero.BO.CriteriaManager.Parameter

The parameter is a terminal expression that is just a specialised IExpression. It was created separately from Expression so that it could store the additional parameters of the field name, table name and parameter type. These are necessary so that the criteria manager component can return a valid SqlExpressionString when required.
The reason for storing this additional info in the expression manager and not parsing it every time a sql statement was required is partly down to performance and partly down to ease of use.
Наследование: IExpression
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Clone ( ) : IExpression

Creates and returns a copy of this IExpression instance.

DoesntRequireParametrisedValue ( ) : bool

Indicates whether the sql operator is some variant of "IS" or "IN", in which case a parameterised value is not required

ExpressionString ( ) : string

Returns an expression string consisting of the parameter name, operator and parameter value

Parameter ( string parameterClause ) : System

Constructor that creates a parameter based on the parameter clause provided

Parameter ( string parameterName, string sqlOperator, string parameterValue ) : System

Constructor that creates a parameter with the parameter name, sql operator and parameter value provided. It is assumed that the database field name is equal to the parameter name unless it is reset later.

Parameter ( string parameterName, string fieldName, string sqlOperator, string parameterValue ) : System

A constructor as before, except that the field name is explicitly provided

Parameter ( string parameterName, string tableName, string fieldName, string sqlOperator, string parameterValue ) : System

A constructor as before, except that the table name and field name are explicitly provided. For other constructors, the table name is initialised as an empty string.

Parameter ( string parameterName, string tableName, string fieldName, string sqlOperator, string parameterValue, ParameterType parameterType ) : System

A constructor as before, except that the parameter type is explicitly provided. For all other constructors, this is initialised as a string type.

SetParameterSqlInfo ( IParameterSqlInfo info ) : void

Copies across the parameterised sql info (see IParameterSqlInfo for more detail)

SqlExpressionString ( ISqlStatement statement, string tableNameFieldNameLeftSeparator, string tableNameFieldNameRightSeparator ) : void

Creates a valid sql expression, e.g. for a "where" clause. See IExpression.SqlExpressionString for more detail.

Приватные методы

Метод Описание
FieldFullName ( string tableFieldNameLeftSeperator, string tableFieldNameRightSeperator ) : string

Returns the full field name, including table name (where applicable), field name and surrounding separators. For instance, with the separators as "[" and "]", the output would be:
[tablename].[fieldname]
See IExpression.SqlExpressionString for more detail.

GetParameterValueAsObject ( ) : object

Converts the parameter value into an object, based on its specified parameter type (see the ParameterType enumeration for more detail). For instance, a number type will be converted to a Decimal object.

GetSqlOperator ( ) : string

Returns the sql operator, with a space before it

GetSqlStringWithNoParameters ( ) : string

Returns the parameter value in valid sql format

Описание методов

Clone() публичный Метод

Creates and returns a copy of this IExpression instance.
public Clone ( ) : IExpression
Результат IExpression

DoesntRequireParametrisedValue() публичный Метод

Indicates whether the sql operator is some variant of "IS" or "IN", in which case a parameterised value is not required
public DoesntRequireParametrisedValue ( ) : bool
Результат bool

ExpressionString() публичный Метод

Returns an expression string consisting of the parameter name, operator and parameter value
public ExpressionString ( ) : string
Результат string

Parameter() публичный Метод

Constructor that creates a parameter based on the parameter clause provided
public Parameter ( string parameterClause ) : System
parameterClause string A clause for a single parameter. /// This must have the syntax:
/// parameterName sqlOperator parameterValue /// (e.g. Field1 >= 3)
/// NOTE_: The parameter value should not be enclosed in inverted /// commas.
Результат System

Parameter() публичный Метод

Constructor that creates a parameter with the parameter name, sql operator and parameter value provided. It is assumed that the database field name is equal to the parameter name unless it is reset later.
public Parameter ( string parameterName, string sqlOperator, string parameterValue ) : System
parameterName string The property name of the parameter
sqlOperator string The sql operator
parameterValue string This should be a parameter as per a sql /// "where" clause. NOTE_: Do not parse out a ' as '' since the criteria /// manager will do this.
Результат System

Parameter() публичный Метод

A constructor as before, except that the field name is explicitly provided
public Parameter ( string parameterName, string fieldName, string sqlOperator, string parameterValue ) : System
parameterName string
fieldName string
sqlOperator string
parameterValue string
Результат System

Parameter() публичный Метод

A constructor as before, except that the table name and field name are explicitly provided. For other constructors, the table name is initialised as an empty string.
public Parameter ( string parameterName, string tableName, string fieldName, string sqlOperator, string parameterValue ) : System
parameterName string
tableName string
fieldName string
sqlOperator string
parameterValue string
Результат System

Parameter() публичный Метод

A constructor as before, except that the parameter type is explicitly provided. For all other constructors, this is initialised as a string type.
public Parameter ( string parameterName, string tableName, string fieldName, string sqlOperator, string parameterValue, ParameterType parameterType ) : System
parameterName string
tableName string
fieldName string
sqlOperator string
parameterValue string
parameterType ParameterType
Результат System

SetParameterSqlInfo() публичный Метод

Copies across the parameterised sql info (see IParameterSqlInfo for more detail)
public SetParameterSqlInfo ( IParameterSqlInfo info ) : void
info IParameterSqlInfo The IParameterSqlInfo object
Результат void

SqlExpressionString() публичный Метод

Creates a valid sql expression, e.g. for a "where" clause. See IExpression.SqlExpressionString for more detail.
public SqlExpressionString ( ISqlStatement statement, string tableNameFieldNameLeftSeparator, string tableNameFieldNameRightSeparator ) : void
statement ISqlStatement
tableNameFieldNameLeftSeparator string
tableNameFieldNameRightSeparator string
Результат void