public class TableCRUDService
extends java.lang.Object
| 构造器和说明 |
|---|
TableCRUDService(Client client,
CryptoKeyPair credential) |
| 限定符和类型 | 方法和说明 |
|---|---|
RetCode |
appendColumns(java.lang.String tableName,
java.util.List<java.lang.String> newColumns)
append new columns to a specific table with table name, new value field names
|
void |
asyncAppendColumns(java.lang.String tableName,
java.util.List<java.lang.String> newColumns,
PrecompiledCallback callback)
async append new columns to a specific table with table name, new value field names
|
void |
asyncCreateTable(java.lang.String tableName,
Common.TableKeyOrder keyOrder,
java.lang.String keyFieldName,
java.util.List<java.lang.String> valueFields,
PrecompiledCallback callback)
async create a table with table name, key name, value field names
|
void |
asyncCreateTable(java.lang.String tableName,
java.lang.String keyFieldName,
java.util.List<java.lang.String> valueFields,
PrecompiledCallback callback)
async create a table with table name, key name, value field names
|
void |
asyncInsert(java.lang.String tableName,
Entry entry,
PrecompiledCallback callback)
async insert data to a specific table with table name, data entry
|
void |
asyncRemove(java.lang.String tableName,
Condition condition,
PrecompiledCallback callback)
async remove data in a specific table with table name, key condition
|
void |
asyncRemove(java.lang.String tableName,
ConditionV320 condition,
PrecompiledCallback callback)
async remove data in a specific table with table name, key condition
|
void |
asyncRemove(java.lang.String tableName,
java.lang.String key,
PrecompiledCallback callback)
async remove data in a specific table with table name, single key
|
void |
asyncUpdate(java.lang.String tableName,
Condition condition,
UpdateFields updateFields,
PrecompiledCallback callback)
async update data to a specific table with table name, condition, updateFields
|
void |
asyncUpdate(java.lang.String tableName,
ConditionV320 condition,
UpdateFields updateFields,
PrecompiledCallback callback)
async update data to a specific table with table name, condition, updateFields
|
void |
asyncUpdate(java.lang.String tableName,
java.lang.String key,
UpdateFields updateFields,
PrecompiledCallback callback)
async update data to a specific table with table name, single key, updateFields
|
RetCode |
createTable(java.lang.String tableName,
Common.TableKeyOrder keyOrder,
java.lang.String keyFieldName,
java.util.List<java.lang.String> valueFields)
create a table with table name, key name, value field names
|
RetCode |
createTable(java.lang.String tableName,
java.lang.String keyFieldName,
java.util.List<java.lang.String> valueFields)
create a table with table name, key name, value field names
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
desc(java.lang.String tableName)
get a specific table key and value fields with table name
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
descWithKeyOrder(java.lang.String tableName)
get a specific table key and value fields with table name
|
long |
getCurrentVersion() |
RetCode |
insert(java.lang.String tableName,
Entry entry)
insert data to a specific table with table name, data entry.
|
RetCode |
insert(TablePrecompiled tablePrecompiled,
Entry entry)
insert data to a specific table with table precompiled, data entry. this method will reduce
tableManager.openTable() overhead
|
RetCode |
remove(java.lang.String tableName,
Condition condition)
remove data in a specific table with table name, key condition
|
RetCode |
remove(java.lang.String tableName,
ConditionV320 condition)
remove data in a specific table with table name, key condition
|
RetCode |
remove(java.lang.String tableName,
java.lang.String key)
remove data in a specific table with table name, single key
|
RetCode |
remove(TablePrecompiled tablePrecompiled,
Condition condition)
remove data in a specific table with table name, key condition this method will reduce
tableManager.openTable() overhead
|
RetCode |
remove(TablePrecompiled tablePrecompiled,
ConditionV320 condition)
remove data in a specific table with table name, key condition this method will reduce
tableManager.openTable() overhead
|
RetCode |
remove(TablePrecompiled tablePrecompiled,
java.lang.String key)
remove data in a specific table with tablePrecompiled, single key this method will reduce
tableManager.openTable() overhead
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
select(java.lang.String tableName,
Condition condition)
select data in a specific table with table name, condition
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
select(java.lang.String tableName,
ConditionV320 condition)
select data in a specific table with table name, condition
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
select(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc,
Condition condition)
select data in a specific table with table name, table desc info, condition. this method will
reduce table.desc() overhead
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
select(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc,
ConditionV320 condition)
select data in a specific table with table name, table desc info, condition. this method will
reduce table.desc() overhead
|
java.util.Map<java.lang.String,java.lang.String> |
select(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc,
java.lang.String key)
select data in a specific table with table name, table desc info, single key this method will
reduce table.desc() overhead
|
java.util.Map<java.lang.String,java.lang.String> |
select(java.lang.String tableName,
java.lang.String key)
select data in a specific table with table name, single key
|
RetCode |
update(java.lang.String tableName,
Condition condition,
UpdateFields updateFields)
update data to a specific table with table name, condition, updateFields
|
RetCode |
update(java.lang.String tableName,
ConditionV320 condition,
UpdateFields updateFields)
update data to a specific table with table name, condition, updateFields
|
RetCode |
update(java.lang.String tableName,
java.lang.String key,
UpdateFields updateFields)
update data to a specific table with table name, single key, updateFields
|
RetCode |
update(TablePrecompiled tablePrecompiled,
Condition condition,
UpdateFields updateFields)
update data to a specific table with tablePrecompiled, key condition, updateFields this
method will reduce tableManager.openTable() overhead
|
RetCode |
update(TablePrecompiled tablePrecompiled,
ConditionV320 condition,
UpdateFields updateFields)
update data to a specific table with tablePrecompiled, key condition, updateFields this
method will reduce tableManager.openTable() overhead
|
RetCode |
update(TablePrecompiled tablePrecompiled,
java.lang.String key,
UpdateFields updateFields)
update data to a specific table with tablePrecompiled, single key, updateFields this method
will reduce tableManager.openTable() overhead
|
public TableCRUDService(Client client, CryptoKeyPair credential)
public long getCurrentVersion()
public RetCode createTable(java.lang.String tableName, java.lang.String keyFieldName, java.util.List<java.lang.String> valueFields) throws ContractException
tableName - table name, will add prefix /tables/ in blockchain, tableName length not
longer than 50 with prefixkeyFieldName - key field name, which length should not be longer than 64valueFields - value field names, which length in total should not be longer than 1024ContractException - throw when contract exec exceptionpublic void asyncCreateTable(java.lang.String tableName,
java.lang.String keyFieldName,
java.util.List<java.lang.String> valueFields,
PrecompiledCallback callback)
tableName - table name, will add prefix /tables/ in blockchain, tableName length not
longer than 50 with prefixkeyFieldName - key field name, which length should not be longer than 64valueFields - value field names, which length in total should not be longer than 1024callback - callback when get receiptpublic RetCode createTable(java.lang.String tableName, Common.TableKeyOrder keyOrder, java.lang.String keyFieldName, java.util.List<java.lang.String> valueFields) throws ContractException
tableName - table name, will add prefix /tables/ in blockchain, tableName length not
longer than 50 with prefixkeyFieldName - key field name, which length should not be longer than 64valueFields - value field names, which length in total should not be longer than 1024ContractException - throw when contract exec exceptionpublic void asyncCreateTable(java.lang.String tableName,
Common.TableKeyOrder keyOrder,
java.lang.String keyFieldName,
java.util.List<java.lang.String> valueFields,
PrecompiledCallback callback)
throws ContractException
tableName - table name, will add prefix /tables/ in blockchain, tableName length not
longer than 50 with prefixkeyFieldName - key field name, which length should not be longer than 64valueFields - value field names, which length in total should not be longer than 1024callback - callback when get receiptContractExceptionpublic RetCode appendColumns(java.lang.String tableName, java.util.List<java.lang.String> newColumns) throws ContractException
tableName - specific table name, table should existnewColumns - new value field names, which length in total should not be longer than
1024, and should not be duplicateContractException - throw when contract exec exceptionpublic void asyncAppendColumns(java.lang.String tableName,
java.util.List<java.lang.String> newColumns,
PrecompiledCallback callback)
tableName - specific table name, table should existnewColumns - new value field names, which length in total should not be longer than
1024, and should not be duplicatecallback - callback when get receiptpublic java.util.List<java.util.Map<java.lang.String,java.lang.String>> select(java.lang.String tableName,
Condition condition)
throws ContractException
tableName - specific table name, table should existcondition - condition about keyContractException - throw when contract exec exceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.String>> select(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc,
Condition condition)
throws ContractException
tableName - specific table name, table should existdesc - table key field and value fields info, [(key_field: [""]),(value_fields: [""])]condition - condition about keyContractException - throw when contract exec exceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.String>> select(java.lang.String tableName,
ConditionV320 condition)
throws ContractException
tableName - specific table name, table should existcondition - condition about keyContractException - throw when contract exec exceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.String>> select(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc,
ConditionV320 condition)
throws ContractException
tableName - specific table name, table should existdesc - table key field and value fields info, [(key_field: [""]),(value_fields: [""])]condition - condition about keyContractException - throw when contract exec exceptionpublic java.util.Map<java.lang.String,java.lang.String> select(java.lang.String tableName,
java.lang.String key)
throws ContractException
tableName - specific table name, table should existkey - specific keyContractException - throw when contract exec exceptionpublic java.util.Map<java.lang.String,java.lang.String> select(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc,
java.lang.String key)
throws ContractException
tableName - specific table name, table should existdesc - table key field and value fields info, [(key_field: [""]),(value_fields: [""])]key - specific keyContractException - throw when contract exec exceptionpublic RetCode insert(java.lang.String tableName, Entry entry) throws ContractException
tableName - specific table name, table should existentry - data entry, which contains key and values map, values size should match the
table value field sizeContractException - throw when contract exec exceptionpublic RetCode insert(TablePrecompiled tablePrecompiled, Entry entry) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addressentry - data entry, which contains key and values map, values size should match the
table value field sizeContractException - throw when contract exec exceptionpublic void asyncInsert(java.lang.String tableName,
Entry entry,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existentry - data entry, which contains key and values map, values size should match the
table value field sizecallback - callback when get receiptContractException - throw when contract exec exceptionpublic RetCode update(java.lang.String tableName, java.lang.String key, UpdateFields updateFields) throws ContractException
tableName - specific table name, table should existkey - specific key, key should existupdateFields - update specific fields' dataContractException - throw when contract exec exceptionpublic RetCode update(TablePrecompiled tablePrecompiled, java.lang.String key, UpdateFields updateFields) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addresskey - specific key, key should existupdateFields - update specific fields' dataContractException - throw when contract exec exceptionpublic RetCode update(java.lang.String tableName, Condition condition, UpdateFields updateFields) throws ContractException
tableName - specific table name, table should existcondition - key conditionupdateFields - update specific fields' dataContractException - throw when contract exec exceptionpublic RetCode update(TablePrecompiled tablePrecompiled, Condition condition, UpdateFields updateFields) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addresscondition - key conditionupdateFields - update specific fields' dataContractException - throw when contract exec exceptionpublic RetCode update(java.lang.String tableName, ConditionV320 condition, UpdateFields updateFields) throws ContractException
tableName - specific table name, table should existcondition - key conditionupdateFields - update specific fields' dataContractException - throw when contract exec exceptionpublic RetCode update(TablePrecompiled tablePrecompiled, ConditionV320 condition, UpdateFields updateFields) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addresscondition - key conditionupdateFields - update specific fields' dataContractException - throw when contract exec exceptionpublic void asyncUpdate(java.lang.String tableName,
java.lang.String key,
UpdateFields updateFields,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existkey - specific key, key should existupdateFields - update specific fields' datacallback - callback when get receiptContractException - throw when contract exec exceptionpublic void asyncUpdate(java.lang.String tableName,
Condition condition,
UpdateFields updateFields,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existcondition - key conditionupdateFields - update specific fields' datacallback - callback when get receiptContractException - throw when contract exec exceptionpublic void asyncUpdate(java.lang.String tableName,
ConditionV320 condition,
UpdateFields updateFields,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existcondition - key conditionupdateFields - update specific fields' datacallback - callback when get receiptContractException - throw when contract exec exceptionpublic RetCode remove(java.lang.String tableName, java.lang.String key) throws ContractException
tableName - specific table name, table should existkey - specific key, key should existContractException - throw when contract exec exceptionpublic RetCode remove(TablePrecompiled tablePrecompiled, java.lang.String key) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addresskey - specific key, key should existContractException - throw when contract exec exceptionpublic RetCode remove(java.lang.String tableName, Condition condition) throws ContractException
tableName - specific table name, table should existcondition - key conditionContractException - throw when contract exec exceptionpublic RetCode remove(TablePrecompiled tablePrecompiled, Condition condition) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addresscondition - key conditionContractException - throw when contract exec exceptionpublic RetCode remove(java.lang.String tableName, ConditionV320 condition) throws ContractException
tableName - specific table name, table should existcondition - key conditionContractException - throw when contract exec exceptionpublic RetCode remove(TablePrecompiled tablePrecompiled, ConditionV320 condition) throws ContractException
tablePrecompiled - specific tablePrecompiled, already load a specific contract addresscondition - key conditionContractException - throw when contract exec exceptionpublic void asyncRemove(java.lang.String tableName,
java.lang.String key,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existkey - specific key, key should existcallback - callback when get receiptContractException - throw when contract exec exceptionpublic void asyncRemove(java.lang.String tableName,
Condition condition,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existcondition - key conditioncallback - callback when get receiptContractException - throw when contract exec exceptionpublic void asyncRemove(java.lang.String tableName,
ConditionV320 condition,
PrecompiledCallback callback)
throws ContractException
tableName - specific table name, table should existcondition - key conditioncallback - callback when get receiptContractException - throw when contract exec exceptionpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> desc(java.lang.String tableName)
throws ContractException
tableName - specific table name, it should existContractException - throw when contract exec exceptionpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> descWithKeyOrder(java.lang.String tableName)
throws ContractException
tableName - specific table name, it should existContractException - throw when contract exec exception