你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

SqlQuerySpec Class

public final class SqlQuerySpec
extends JsonSerializable

Represents a SQL query in the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
SqlQuerySpec()

Initializes a new instance of the SqlQuerySpec class.

SqlQuerySpec(String queryText)

Initializes a new instance of the SqlQuerySpec class with the text of the query.

SqlQuerySpec(String queryText, SqlParameterCollection parameters)

Initializes a new instance of the SqlQuerySpec class with the text of the query and parameters.

Method Summary

Modifier and Type Method and Description
SqlParameterCollection getParameters()

Gets the collection of query parameters.

java.lang.String getQueryText()

Gets the text of the query.

void setParameters(SqlParameterCollection parameters)

Sets the collection of query parameters.

void setQueryText(String queryText)

Sets the text of the query.

Methods inherited from JsonSerializable

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

SqlQuerySpec

public SqlQuerySpec()

Initializes a new instance of the SqlQuerySpec class.

SqlQuerySpec

public SqlQuerySpec(String queryText)

Initializes a new instance of the SqlQuerySpec class with the text of the query.

Parameters:

queryText - the query text.

SqlQuerySpec

public SqlQuerySpec(String queryText, SqlParameterCollection parameters)

Initializes a new instance of the SqlQuerySpec class with the text of the query and parameters.

Parameters:

queryText - the query text.
parameters - the query parameters.

Method Details

getParameters

public SqlParameterCollection getParameters()

Gets the collection of query parameters.

Returns:

the query parameters.

getQueryText

public String getQueryText()

Gets the text of the query.

Returns:

the query text.

setParameters

public void setParameters(SqlParameterCollection parameters)

Sets the collection of query parameters.

Parameters:

parameters - the query parameters.

setQueryText

public void setQueryText(String queryText)

Sets the text of the query.

Parameters:

queryText - the query text.

Applies to