T
- The type of object being processed.public class InsertRecordsRequest<T> extends Object
GPUdb.insertRecords(InsertRecordsRequest)
.
options
can be used to customize this function's behavior. The only parameter available is update_on_existing_pk
. The value can be either 'true' or 'false'. If the table has a primary key
and if update_on_existing_pk
is 'true' then if any of the
records being added have the same primary key as existing records, the existing records are replaced (i.e. *updated*) with the
given records. If update_on_existing_pk
is false and if the records being added have the same primary key as existing
records, the given records with existing primary keys are ignored (the existing records are left unchanged). It is quite possible
that in this case some of the given records will be inserted and some (those having existing primary keys) will be ignored (or
updated). If the specified table does not have a primary key column then the update_on_existing_pk
option is ignored.
The Raw version of this method can be used to specify the encoding scheme of the request.Modifier and Type | Class and Description |
---|---|
static class |
InsertRecordsRequest.Options
Optional parameters.
|
Constructor and Description |
---|
InsertRecordsRequest()
Constructs an InsertRecordsRequest object with default parameters.
|
InsertRecordsRequest(String tableName,
List<T> data,
Map<String,String> options)
Constructs an InsertRecordsRequest object with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
The Raw version of this method can be used to specify the encoding scheme of the request.
|
List<T> |
getData()
The Raw version of this method can be used to specify the encoding scheme of the request.
|
Map<String,String> |
getOptions()
The Raw version of this method can be used to specify the encoding scheme of the request.
|
String |
getTableName()
The Raw version of this method can be used to specify the encoding scheme of the request.
|
int |
hashCode()
The Raw version of this method can be used to specify the encoding scheme of the request.
|
InsertRecordsRequest<T> |
setData(List<T> data)
The Raw version of this method can be used to specify the encoding scheme of the request.
|
InsertRecordsRequest<T> |
setOptions(Map<String,String> options)
The Raw version of this method can be used to specify the encoding scheme of the request.
|
InsertRecordsRequest<T> |
setTableName(String tableName)
The Raw version of this method can be used to specify the encoding scheme of the request.
|
String |
toString()
The Raw version of this method can be used to specify the encoding scheme of the request.
|
public InsertRecordsRequest()
public InsertRecordsRequest(String tableName, List<T> data, Map<String,String> options)
tableName
- Table to which the records are to be added. Must be an existing table.data
- An array of binary-encoded data for the records to be added. All records must be of the same type as that of the
table. Empty array if listEncoding
is json
.options
- Optional parameters.
primary key
, then if the value is 'true' then if any of the records being added have the same primary key as
existing records, the existing records are replaced (i.e. *updated*) with the given records. If 'false' and
if the records being added have the same primary key as existing records, the given records with existing
primary keys are ignored (the existing records are left unchanged). It is quite possible that in this case
some of the given records will be inserted and some (those having existing primary keys) will be ignored (or
updated). If the specified table does not have a primary key column then this optional parameter is ignored.
Values: true, false.
public String getTableName()
public InsertRecordsRequest<T> setTableName(String tableName)
tableName
- Table to which the records are to be added. Must be an existing table.this
to mimic the builder pattern.public List<T> getData()
listEncoding
is json
.public InsertRecordsRequest<T> setData(List<T> data)
data
- An array of binary-encoded data for the records to be added. All records must be of the same type as that of the
table. Empty array if listEncoding
is json
.this
to mimic the builder pattern.public Map<String,String> getOptions()
primary
key
, then if the value is 'true' then if any of the records being added have the same primary key as existing
records, the existing records are replaced (i.e. *updated*) with the given records. If 'false' and if the records
being added have the same primary key as existing records, the given records with existing primary keys are ignored
(the existing records are left unchanged). It is quite possible that in this case some of the given records will be
inserted and some (those having existing primary keys) will be ignored (or updated). If the specified table does not
have a primary key column then this optional parameter is ignored. Values: true, false.
public InsertRecordsRequest<T> setOptions(Map<String,String> options)
options
- Optional parameters.
primary key
, then if the value is 'true' then if any of the records being added have the same primary key as
existing records, the existing records are replaced (i.e. *updated*) with the given records. If 'false' and
if the records being added have the same primary key as existing records, the given records with existing
primary keys are ignored (the existing records are left unchanged). It is quite possible that in this case
some of the given records will be inserted and some (those having existing primary keys) will be ignored (or
updated). If the specified table does not have a primary key column then this optional parameter is ignored.
Values: true, false.
this
to mimic the builder pattern.public boolean equals(Object obj)
public String toString()
Copyright © 2016. All rights reserved.