Class QueryParameter
-
Method Summary
Modifier and TypeMethodDescriptionstatic QueryParameterConstruct a new QueryParameter from a given value.static QueryParameterConstruct a new QueryParameter from a given name and value.getName()Retrieve the parameter name.Retrieve the `scale` or `maxLength` of the parameter.intRetrieve the SQL type as an ordinal fromTypes.getType()Retrieve the QueryColumnType of the parameter.getValue()Retrieve the parameter value.booleanIs this a list parameter?booleanisNull()Returns whether this parameter has a null value override.booleanIs this parameter specifically typed as 'null'?toSQLType(IBoxContext context) Retrieve the value casted to the declared SQL type of the parameter..
-
Method Details
-
fromAny
Construct a new QueryParameter from a given value.If the value is an IStruct, it will be used as the construction arguments to
QueryParameter(String, IStruct). Otherwise, the QueryParameter will be constructed with the value as the `value` property of the IStruct, and no sqltype, null, list, or maxLength/scale properties. -
fromAny
Construct a new QueryParameter from a given name and value.If the value is an IStruct, it will be used as the construction arguments to
QueryParameter(String, IStruct). Otherwise, the QueryParameter will be constructed with the value as the `value` property of the IStruct, and no sqltype, null, list, or maxLength/scale properties.- Parameters:
name- The parameter name. Null is completely valid.value- The parameter value.
-
getName
Retrieve the parameter name. -
isListParam
public boolean isListParam()Is this a list parameter? -
isNullParam
public boolean isNullParam()Is this parameter specifically typed as 'null'? -
getValue
Retrieve the parameter value. -
toSQLType
Retrieve the value casted to the declared SQL type of the parameter.. -
getType
Retrieve the QueryColumnType of the parameter. -
getSqlTypeAsInt
public int getSqlTypeAsInt()Retrieve the SQL type as an ordinal fromTypes.For example,
Types.VARCHARis 12. -
getScaleOrLength
Retrieve the `scale` or `maxLength` of the parameter.For
QueryColumnType.DOUBLEandQueryColumnType.DECIMAL, this is the `scale`. For all other types, this is the `maxLength` property. -
isNull
public boolean isNull()Returns whether this parameter has a null value override.For example:
<bx:queryparam null="true" />
-