org.eclipse.datatools.connectivity.oda.spec
Class QuerySpecification

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.spec.QuerySpecification
Direct Known Subclasses:
AdvancedQuerySpecification

public class QuerySpecification
extends java.lang.Object

Specification of the query characteristics to apply when preparing and executing an IQuery.

Since:
3.2 (DTP 1.7)

Nested Class Summary
 class QuerySpecification.ParameterIdentifier
          The identifier of a data set query parameter, defined by its native name and/or id (1-based).
 
Method Summary
 java.lang.Object getParameterValue(int parameterId)
          Gets the input value(s) of a data set query parameter, identified by its native name.
 java.lang.Object getParameterValue(QuerySpecification.ParameterIdentifier paramIdentifier)
          Gets the input value(s) of a data set query parameter, identified by native name or id.
 java.lang.Object getParameterValue(java.lang.String parameterName)
          Gets the input value(s) of a data set query parameter, identified by its native name.
 java.util.Map<QuerySpecification.ParameterIdentifier,java.lang.Object> getParameterValues()
          Gets the values of all input parameters of the associated IQuery, with each parameter identified by name or id as the key to its corresponding input value(s).
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Gets the values of all data set query properties, with each property name as the key to its corresponding value(s).
 java.lang.Object getProperty(java.lang.String propertyName)
          Gets the value(s) of a data set query property.
 ResultSetSpecification getResultSetSpecification()
          Gets the current result set specification of an IQuery.
 boolean hasResultSetSpecification()
          Indicates whether this contains a ResultSetSpecification with a non-empty content.
 void setParameterValue(int parameterId, java.lang.Object value)
          Specifies the input value(s) of a data set query parameter, identified by its id.
 void setParameterValue(QuerySpecification.ParameterIdentifier paramIdentifier, java.lang.Object value)
          Specifies the input value(s) of a data set query parameter, identified by native name or id.
 void setParameterValue(java.lang.String parameterName, java.lang.Object value)
          Specifies the input value(s) of a data set query parameter, identified by its native name.
 void setParameterValues(java.util.Map<QuerySpecification.ParameterIdentifier,java.lang.Object> paramValues)
          Specifies the values of all input parameters of the associated IQuery, with each parameter identified by name or id as the key to its corresponding input value(s).
 void setProperties(java.util.Map<java.lang.String,java.lang.Object> propertyMap)
          Specifies the values of all data set query properties, with each property name as the key to its corresponding value(s).
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          Specifies the value(s) of a data set query property, overriding existing values if any.
 void setResultSetSpecification(ResultSetSpecification resultSpec)
          Specifies the characteristics of all the result set(s) to be retrieved by the associated IQuery.
 void validate(ValidationContext context)
          Validates this in the specified context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
Specifies the value(s) of a data set query property, overriding existing values if any.
A property may have multiple values kept in a Collection. The property value specified here may be the same as the value set separately by IQuery.setProperty(String, String), which is set after a query is prepared.
A property value may be null, whose handling is specific to individual driver implementation. An ODA consumer does not necessarily distinguish whether a property value is not set or explicitly set to null.

Parameters:
propertyName - name of the property
value - the value of the specified property; may be null

getProperty

public java.lang.Object getProperty(java.lang.String propertyName)
Gets the value(s) of a data set query property.
A property may have multiple values kept in a Collection. The property value specified here may be the same as the value set separately by IQuery.setProperty(String, String), which is set after a query is prepared.
Its handling is optional and specific to individual driver implementation on whether to apply this property value(s) when preparing a query.
If a property name is not recognized by the driver, it should simply ignore, and not throw an exception.
A property value may be null, whose handling is specific to individual driver implementation. An ODA consumer does not necessarily distinguish whether a property value is not set or explicitly set to null.

Parameters:
propertyName - name of the property
Returns:
value the value of the specified property; may be null

setProperties

public void setProperties(java.util.Map<java.lang.String,java.lang.Object> propertyMap)
Specifies the values of all data set query properties, with each property name as the key to its corresponding value(s).
A property may have multiple values kept in a Collection. The property values specified here may be the same as those set separately by IQuery.setProperty(String, String), which are set after a query is prepared.
A property value may be null, whose handling is specific to individual driver implementation. An ODA consumer does not necessarily distinguish whether a property value is not set or explicitly set to null.

Parameters:
propertyMap - a Map of data set query properties in name-value pairs

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Gets the values of all data set query properties, with each property name as the key to its corresponding value(s).
A property may have multiple values kept in a Collection. The property values specified here may be the same as those set separately by IQuery.setProperty(String, String), which are set after a query is prepared.
Its handling is optional and specific to individual driver implementation on whether to apply these property values when preparing a query.
If a property name is not recognized by the driver, it should simply ignore, and not throw an exception.
A property value may be null, whose handling is specific to individual driver implementation. An ODA consumer does not necessarily distinguish whether a property value is not set or explicitly set to null.

Returns:
a Map of all currently specified data set query properties with each property name as the key to its corresponding value(s); may be empty if no property value is specified

setParameterValue

public void setParameterValue(java.lang.String parameterName,
                              java.lang.Object value)
Specifies the input value(s) of a data set query parameter, identified by its native name.
A parameter may have multiple input values kept in a Collection. The parameter value specified here may be the same as the value set separately by a query's set by data type method, which is set after a query is prepared.
A value in primitive data type is specified in its corresponding object type. A parameter value may be null, whose handling is specific to individual driver implementation.

Parameters:
parameterName - native name of the parameter
value - input value of the specified parameter
See Also:
setParameterValue(int, Object)

setParameterValue

public void setParameterValue(int parameterId,
                              java.lang.Object value)
Specifies the input value(s) of a data set query parameter, identified by its id.
A parameter may have multiple input values kept in a Collection. The parameter value specified here may be the same as the value set separately by a query's set by data type method, which is set after a query is prepared.
A value in primitive data type is specified in its corresponding object type. A parameter value may be null, whose handling is specific to individual driver implementation.

Parameters:
parameterId - id of the parameter (1-based)
value - input value of the specified parameter
See Also:
setParameterValue(String, Object)

setParameterValue

public void setParameterValue(QuerySpecification.ParameterIdentifier paramIdentifier,
                              java.lang.Object value)
Specifies the input value(s) of a data set query parameter, identified by native name or id.

Parameters:
paramIdentifier - a QuerySpecification.ParameterIdentifier that identifies an input parameter by its native name or id (1-based)
value - input value of the specified parameter
See Also:
setParameterValue(String, Object), setParameterValue(int, Object)

getParameterValue

public java.lang.Object getParameterValue(java.lang.String parameterName)
Gets the input value(s) of a data set query parameter, identified by its native name.
A parameter may have multiple input values kept in a Collection. The parameter value specified here may be the same as the value set separately by a query's set by data type method, which is set after a query is prepared.
Its handling is optional and specific to individual driver implementation on whether to apply the parameter input value(s) when preparing a query.
A value in primitive data type is specified in its corresponding object type. A parameter value may be null, whose handling is specific to individual driver implementation.

Parameters:
parameterName - native name of the parameter
Returns:
input value of the specified parameter
See Also:
getParameterValue(int)

getParameterValue

public java.lang.Object getParameterValue(int parameterId)
Gets the input value(s) of a data set query parameter, identified by its native name.
A parameter may have multiple input values kept in a Collection. The parameter value specified here may be the same as the value set separately by a query's set by data type method, which is set after a query is prepared.
Its handling is optional and specific to individual driver implementation on whether to apply the parameter input value(s) when preparing a query.
A value in primitive data type is specified in its corresponding object type. A parameter value may be null, whose handling is specific to individual driver implementation.

Parameters:
parameterId - id of the parameter (1-based)
Returns:
input value of the specified parameter
See Also:
getParameterValue(String)

getParameterValue

public java.lang.Object getParameterValue(QuerySpecification.ParameterIdentifier paramIdentifier)
Gets the input value(s) of a data set query parameter, identified by native name or id.

Parameters:
paramIdentifier - a QuerySpecification.ParameterIdentifier that identifies an input parameter by its native name or id (1-based)
Returns:
input value of the specified parameter
See Also:
getParameterValue(String), getParameterValue(int)

setParameterValues

public void setParameterValues(java.util.Map<QuerySpecification.ParameterIdentifier,java.lang.Object> paramValues)
Specifies the values of all input parameters of the associated IQuery, with each parameter identified by name or id as the key to its corresponding input value(s).
A parameter may have multiple input values kept in a Collection. The parameter values specified here may be the same as those set separately by a query's set by data type methods, which are set after a query is prepared.
A value in primitive data type is specified in its corresponding object type. A parameter value may be null, whose handling is specific to individual driver implementation.

Parameters:
paramValues - a Map of QuerySpecification.ParameterIdentifier as the key to its corresponding input value(s)

getParameterValues

public java.util.Map<QuerySpecification.ParameterIdentifier,java.lang.Object> getParameterValues()
Gets the values of all input parameters of the associated IQuery, with each parameter identified by name or id as the key to its corresponding input value(s).
A parameter may have multiple input values kept in a Collection. The parameter values specified here may be the same as those set separately by a query's set by data type methods, which are set after a query is prepared.
Its handling is optional and specific to individual driver implementation on whether to apply these parameter input values when preparing a query.
A value in primitive data type is specified in its corresponding object type. A parameter value may be null, whose handling is specific to individual driver implementation.

Returns:
a Map of all currently specified data set query parameters with each QuerySpecification.ParameterIdentifier as the key to its corresponding input value(s); may be empty if no parameter value is specified

setResultSetSpecification

public void setResultSetSpecification(ResultSetSpecification resultSpec)
Specifies the characteristics of all the result set(s) to be retrieved by the associated IQuery.

Parameters:
resultSpec - specification of a query's result set(s)

getResultSetSpecification

public ResultSetSpecification getResultSetSpecification()
Gets the current result set specification of an IQuery.

Returns:
the current ResultSetSpecification, or null if not specified

hasResultSetSpecification

public boolean hasResultSetSpecification()
Indicates whether this contains a ResultSetSpecification with a non-empty content.

Returns:
true if this contains a non-empty ResultSetSpecification; false otherwise
Since:
3.3.1 (DTP 1.8.1)

validate

public void validate(ValidationContext context)
              throws OdaException
Validates this in the specified context.

Parameters:
context - context for validation; may be null which would limit the scope of validation
Throws:
OdaException - if validation failed. The exception thrown may be a chained OdaException, which identifies each of those specification component(s) that has caused the validation exception.
Since:
3.2.2 (DTP 1.7.2)
See Also:
org.eclipse.datatools.connectivity.oda.spec.util.ValidatorUtil}