Package oracle.nosql.driver.ops
Class GetRequest
- java.lang.Object
-
- oracle.nosql.driver.ops.Request
-
- oracle.nosql.driver.ops.ReadRequest
-
- oracle.nosql.driver.ops.GetRequest
-
public class GetRequest extends oracle.nosql.driver.ops.ReadRequestRepresents the input to aNoSQLHandle.get(oracle.nosql.driver.ops.GetRequest)operation which returns a single row based on the specified key.
-
-
Constructor Summary
Constructors Constructor Description GetRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapValuegetKey()Returns the primary key used for the operation.GetRequestsetCompartment(java.lang.String compartment)Cloud service only.GetRequestsetConsistency(Consistency consistency)Sets theConsistencyto use for the operation.GetRequestsetKey(MapValue key)Sets the primary key used for the get operation.GetRequestsetKeyFromJson(java.lang.String jsonValue, JsonOptions options)Sets the key to use for the get operation based on a JSON string.GetRequestsetTableName(java.lang.String tableName)Sets the table name to use for the operation.GetRequestsetTimeout(int timeoutMs)Sets the request timeout value, in milliseconds.-
Methods inherited from class oracle.nosql.driver.ops.ReadRequest
getConsistencyInternal, getTableNameInternal
-
Methods inherited from class oracle.nosql.driver.ops.Request
getCompartment
-
-
-
-
Method Detail
-
getKey
public MapValue getKey()
Returns the primary key used for the operation. This is a required parameter.- Returns:
- the key
-
setKey
public GetRequest setKey(MapValue key)
Sets the primary key used for the get operation. This is a required parameter.- Parameters:
key- the primary key- Returns:
- this
-
setKeyFromJson
public GetRequest setKeyFromJson(java.lang.String jsonValue, JsonOptions options)
Sets the key to use for the get operation based on a JSON string. This is a convenience method equivalent to:setKey(FieldValue.createFromJson(jsonValue, null));
- Parameters:
jsonValue- the row value as a JSON stringoptions- optional configuration to specify how to map JSON data, may be null- Returns:
- this
-
setTableName
public GetRequest setTableName(java.lang.String tableName)
Sets the table name to use for the operation. This is a required parameter.- Parameters:
tableName- the table name- Returns:
- this
-
setCompartment
public GetRequest setCompartment(java.lang.String compartment)
Cloud service only.Sets the name or id of a compartment to be used for this operation.
The compartment may be specified as either a name (or path for nested compartments) or as an id (OCID). A name (vs id) can only be used when authenticated using a specific user identity. It is not available if authenticated as an Instance Principal which can be done when calling the service from a compute instance in the Oracle Cloud Infrastructure. See
SignatureProvider.createWithInstancePrincipal()- Parameters:
compartment- the name or id. If using a nested compartment, specify the full compartment pathcompartmentA.compartmentB, but exclude the name of the root compartment (tenant).- Returns:
- this
-
setConsistency
public GetRequest setConsistency(Consistency consistency)
Sets theConsistencyto use for the operation. This parameter is optional and if not set the default consistency configured for theNoSQLHandleis used.- Parameters:
consistency- the Consistency- Returns:
- this
-
setTimeout
public GetRequest setTimeout(int timeoutMs)
Sets the request timeout value, in milliseconds. This overrides any default value set inNoSQLHandleConfig. The value must be positive.- Parameters:
timeoutMs- the timeout value, in milliseconds- Returns:
- this
- Throws:
java.lang.IllegalArgumentException- if the timeout value is less than or equal to 0
-
-