public final class CouchbaseExecutor extends Object implements Closeable
SELECT * FROM account WHERE accountId = ?
SELECT * FROM account WHERE accountId = #{accountId}
SELECT * FROM account WHERE accountId = $accountId
or SELECT * FROM account WHERE accountId = $1
Modifier and Type | Field and Description |
---|---|
static String |
_ID
It's name of object id set in Map/Object array.
|
static String |
ID
Property name of id.
|
Constructor and Description |
---|
CouchbaseExecutor(com.couchbase.client.java.Cluster cluster)
Instantiates a new couchbase executor.
|
CouchbaseExecutor(com.couchbase.client.java.Cluster cluster,
com.couchbase.client.java.Bucket bucket)
Instantiates a new couchbase executor.
|
CouchbaseExecutor(com.couchbase.client.java.Cluster cluster,
com.couchbase.client.java.Bucket bucket,
com.landawn.abacus.util.SQLMapper sqlMapper)
Instantiates a new couchbase executor.
|
CouchbaseExecutor(com.couchbase.client.java.Cluster cluster,
com.couchbase.client.java.Bucket bucket,
com.landawn.abacus.util.SQLMapper sqlMapper,
com.landawn.abacus.util.AsyncExecutor asyncExecutor)
Instantiates a new couchbase executor.
|
Modifier and Type | Method and Description |
---|---|
com.landawn.abacus.util.ContinuableFuture<Long> |
asyncCount(String query,
Object... parameters)
Deprecated.
may be misused and it's inefficient.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> |
asyncExecute(com.couchbase.client.java.query.N1qlQuery query)
Async execute.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> |
asyncExecute(com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Async execute.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> |
asyncExecute(String query)
Async execute.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> |
asyncExecute(String query,
Object... parameters)
Async execute.
|
com.landawn.abacus.util.ContinuableFuture<Boolean> |
asyncExists(String query,
Object... parameters)
Always remember to set "
LIMIT 1 " in the sql statement for better performance. |
<T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<T>> |
asyncFindFirst(Class<T> targetClass,
String query,
Object... parameters)
Async find first.
|
<T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<T>> |
asyncGet(Class<T> targetClass,
String id)
Async get.
|
<T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<T>> |
asyncGet(Class<T> targetClass,
String id,
long timeout,
TimeUnit timeUnit)
Async get.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument>> |
asyncGet(String id)
Async get.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument>> |
asyncGet(String id,
long timeout,
TimeUnit timeUnit)
Async get.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncGett(Class<T> targetClass,
String id)
Async gett.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncGett(Class<T> targetClass,
String id,
long timeout,
TimeUnit timeUnit)
Async gett.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> |
asyncGett(String id)
Async gett.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> |
asyncGett(String id,
long timeout,
TimeUnit timeUnit)
Async gett.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncInsert(T document)
Async insert.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncInsert(T document,
long timeout,
TimeUnit timeUnit)
Async insert.
|
<T> com.landawn.abacus.util.ContinuableFuture<List<T>> |
asyncList(Class<T> targetClass,
String query,
Object... parameters)
Async list.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> |
asyncQuery(Class<?> targetClass,
com.couchbase.client.java.query.N1qlQuery query)
Async query.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> |
asyncQuery(Class<?> targetClass,
com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Async query.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> |
asyncQuery(Class<?> targetClass,
String query,
Object... parameters)
Async query.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> |
asyncQuery(com.couchbase.client.java.query.N1qlQuery query)
Async query.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> |
asyncQuery(com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Async query.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> |
asyncQuery(String query,
Object... parameters)
Async query.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalBoolean> |
asyncQueryForBoolean(String query,
Object... parameters)
Async query for boolean.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalByte> |
asyncQueryForByte(String query,
Object... parameters)
Async query for byte.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalChar> |
asyncQueryForChar(String query,
Object... parameters)
Async query for char.
|
<T extends Date> |
asyncQueryForDate(Class<T> targetClass,
String query,
Object... parameters)
Async query for date.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<Date>> |
asyncQueryForDate(String query,
Object... parameters)
Async query for date.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalDouble> |
asyncQueryForDouble(String query,
Object... parameters)
Async query for double.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalFloat> |
asyncQueryForFloat(String query,
Object... parameters)
Async query for float.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalInt> |
asyncQueryForInt(String query,
Object... parameters)
Async query for int.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalLong> |
asyncQueryForLong(String query,
Object... parameters)
Async query for long.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalShort> |
asyncQueryForShort(String query,
Object... parameters)
Async query for short.
|
<V> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<V>> |
asyncQueryForSingleResult(Class<V> targetClass,
String query,
Object... parameters)
Async query for single result.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<String>> |
asyncQueryForString(String query,
Object... parameters)
Async query for string.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncRemove(Class<T> targetClass,
String id)
Async remove.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncRemove(Class<T> targetClass,
String id,
long timeout,
TimeUnit timeUnit)
Async remove.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> |
asyncRemove(String id)
Async remove.
|
com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> |
asyncRemove(String id,
long timeout,
TimeUnit timeUnit)
Async remove.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncRemove(T document)
Async remove.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncRemove(T document,
long timeout,
TimeUnit timeUnit)
Async remove.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncReplace(T document)
Async replace.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncReplace(T document,
long timeout,
TimeUnit timeUnit)
Async replace.
|
<T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<T>> |
asyncStream(Class<T> targetClass,
com.couchbase.client.java.query.N1qlQuery query)
Async stream.
|
<T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<T>> |
asyncStream(Class<T> targetClass,
com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Async stream.
|
<T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<T>> |
asyncStream(Class<T> targetClass,
String query,
Object... parameters)
Async stream.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject>> |
asyncStream(com.couchbase.client.java.query.N1qlQuery query)
Async stream.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject>> |
asyncStream(com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Async stream.
|
com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject>> |
asyncStream(String query,
Object... parameters)
Async stream.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncUpsert(T document)
Async upsert.
|
<T> com.landawn.abacus.util.ContinuableFuture<T> |
asyncUpsert(T document,
long timeout,
TimeUnit timeUnit)
Async upsert.
|
com.couchbase.client.java.Bucket |
bucket()
Bucket.
|
void |
close()
Close.
|
com.couchbase.client.java.Cluster |
cluster()
Cluster.
|
long |
count(String query,
Object... parameters)
Deprecated.
may be misused and it's inefficient.
|
com.couchbase.client.java.query.N1qlQueryResult |
execute(com.couchbase.client.java.query.N1qlQuery query)
Execute.
|
com.couchbase.client.java.query.N1qlQueryResult |
execute(com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Execute.
|
com.couchbase.client.java.query.N1qlQueryResult |
execute(String query)
Execute.
|
com.couchbase.client.java.query.N1qlQueryResult |
execute(String query,
Object... parameters)
Execute.
|
boolean |
exists(String query,
Object... parameters)
Always remember to set "
LIMIT 1 " in the sql statement for better performance. |
static com.landawn.abacus.DataSet |
extractData(Class<?> targetClass,
com.couchbase.client.java.query.N1qlQueryResult resultSet)
Extract data.
|
static com.landawn.abacus.DataSet |
extractData(com.couchbase.client.java.query.N1qlQueryResult resultSet)
Extract data.
|
<T> com.landawn.abacus.util.u.Optional<T> |
findFirst(Class<T> targetClass,
String query,
Object... parameters)
Find first.
|
static <T> T |
fromJSON(Class<T> targetClass,
String json)
Returns an instance of the specified target class with the property values from the specified JSON String.
|
<T> com.landawn.abacus.util.u.Optional<T> |
get(Class<T> targetClass,
String id)
Gets the.
|
<T> com.landawn.abacus.util.u.Optional<T> |
get(Class<T> targetClass,
String id,
long timeout,
TimeUnit timeUnit)
Gets the.
|
com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument> |
get(String id)
Gets the.
|
com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument> |
get(String id,
long timeout,
TimeUnit timeUnit)
Gets the.
|
<T> T |
gett(Class<T> targetClass,
String id)
Gets the t.
|
<T> T |
gett(Class<T> targetClass,
String id,
long timeout,
TimeUnit timeUnit)
Gets the t.
|
com.couchbase.client.java.document.JsonDocument |
gett(String id)
Gets the t.
|
com.couchbase.client.java.document.JsonDocument |
gett(String id,
long timeout,
TimeUnit timeUnit)
Gets the t.
|
static String |
idNameOf(String bucketName)
Id name of.
|
<T> T |
insert(T document)
Insert.
|
<T> T |
insert(T document,
long timeout,
TimeUnit timeUnit)
Insert.
|
<T> List<T> |
list(Class<T> targetClass,
String query,
Object... parameters)
List.
|
com.landawn.abacus.DataSet |
query(Class<?> targetClass,
com.couchbase.client.java.query.N1qlQuery query)
Query.
|
com.landawn.abacus.DataSet |
query(Class<?> targetClass,
com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Query.
|
com.landawn.abacus.DataSet |
query(Class<?> targetClass,
String query,
Object... parameters)
Query.
|
com.landawn.abacus.DataSet |
query(com.couchbase.client.java.query.N1qlQuery query)
Query.
|
com.landawn.abacus.DataSet |
query(com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Query.
|
com.landawn.abacus.DataSet |
query(String query,
Object... parameters)
Query.
|
com.landawn.abacus.util.u.OptionalBoolean |
queryForBoolean(String query,
Object... parameters)
Query for boolean.
|
com.landawn.abacus.util.u.OptionalByte |
queryForByte(String query,
Object... parameters)
Query for byte.
|
com.landawn.abacus.util.u.OptionalChar |
queryForChar(String query,
Object... parameters)
Query for char.
|
<T extends Date> |
queryForDate(Class<T> targetClass,
String query,
Object... parameters)
Query for date.
|
com.landawn.abacus.util.u.Nullable<Date> |
queryForDate(String query,
Object... parameters)
Query for date.
|
com.landawn.abacus.util.u.OptionalDouble |
queryForDouble(String query,
Object... parameters)
Query for double.
|
com.landawn.abacus.util.u.OptionalFloat |
queryForFloat(String query,
Object... parameters)
Query for float.
|
com.landawn.abacus.util.u.OptionalInt |
queryForInt(String query,
Object... parameters)
Query for int.
|
com.landawn.abacus.util.u.OptionalLong |
queryForLong(String query,
Object... parameters)
Query for long.
|
com.landawn.abacus.util.u.OptionalShort |
queryForShort(String query,
Object... parameters)
Query for short.
|
<V> com.landawn.abacus.util.u.Nullable<V> |
queryForSingleResult(Class<V> targetClass,
String query,
Object... parameters)
Query for single result.
|
com.landawn.abacus.util.u.Nullable<String> |
queryForString(String query,
Object... parameters)
Query for string.
|
static void |
registerIdProperty(Class<?> cls,
String idPropertyName)
The object id ("_id") property will be read from/write to the specified property .
|
<T> T |
remove(Class<T> targetClass,
String id)
Removes the.
|
<T> T |
remove(Class<T> targetClass,
String id,
long timeout,
TimeUnit timeUnit)
Removes the.
|
com.couchbase.client.java.document.JsonDocument |
remove(String id)
Removes the.
|
com.couchbase.client.java.document.JsonDocument |
remove(String id,
long timeout,
TimeUnit timeUnit)
Removes the.
|
<T> T |
remove(T document)
Removes the.
|
<T> T |
remove(T document,
long timeout,
TimeUnit timeUnit)
Removes the.
|
<T> T |
replace(T document)
Replace.
|
<T> T |
replace(T document,
long timeout,
TimeUnit timeUnit)
Replace.
|
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
com.couchbase.client.java.query.N1qlQuery query)
Stream.
|
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Stream.
|
<T> com.landawn.abacus.util.stream.Stream<T> |
stream(Class<T> targetClass,
String query,
Object... parameters)
Stream.
|
com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject> |
stream(com.couchbase.client.java.query.N1qlQuery query)
Stream.
|
com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject> |
stream(com.couchbase.client.java.query.N1qlQuery query,
long timeout,
TimeUnit timeUnit)
Stream.
|
com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject> |
stream(String query,
Object... parameters)
Stream.
|
static <T> T |
toEntity(Class<T> targetClass,
com.couchbase.client.java.document.JsonDocument jsonDocument)
The id in the specified
jsonDocument will be set to the returned object if and only if the id is not null or empty and the content in jsonDocument doesn't contain any "id" property, and it's acceptable to the targetClass . |
static <T> T |
toEntity(Class<T> targetClass,
com.couchbase.client.java.document.json.JsonObject jsonObject)
To entity.
|
static <T> T |
toEntity(Class<T> targetClass,
com.couchbase.client.java.query.N1qlQueryRow row)
To entity.
|
static String |
toJSON(com.couchbase.client.java.document.json.JsonArray jsonArray)
To JSON.
|
static String |
toJSON(com.couchbase.client.java.document.JsonDocument jsonDocument)
To JSON.
|
static String |
toJSON(com.couchbase.client.java.document.json.JsonObject jsonObject)
To JSON.
|
static com.couchbase.client.java.document.json.JsonArray |
toJsonArray(Object... a)
To json array.
|
static com.couchbase.client.java.document.json.JsonArray |
toJsonArray(Object obj)
To json array.
|
static com.couchbase.client.java.document.JsonDocument |
toJsonDocument(Object... a)
The id for the target document is got from the "id" property in the specified
a . |
static com.couchbase.client.java.document.JsonDocument |
toJsonDocument(Object obj)
The id for the target document is got from the "id" property in the specified
obj . |
static com.couchbase.client.java.document.json.JsonObject |
toJsonObject(Object... a)
To json object.
|
static com.couchbase.client.java.document.json.JsonObject |
toJsonObject(Object obj)
To json object.
|
static <T> List<T> |
toList(Class<T> targetClass,
com.couchbase.client.java.query.N1qlQueryResult resultSet)
To list.
|
<T> T |
upsert(T document)
All the signed properties will be updated/inserted into data store.
|
<T> T |
upsert(T document,
long timeout,
TimeUnit timeUnit)
All the signed properties will be updated/inserted into data store.
|
public static final String _ID
public static final String ID
public CouchbaseExecutor(com.couchbase.client.java.Cluster cluster)
cluster
- the clusterpublic CouchbaseExecutor(com.couchbase.client.java.Cluster cluster, com.couchbase.client.java.Bucket bucket)
cluster
- the clusterbucket
- the bucketpublic CouchbaseExecutor(com.couchbase.client.java.Cluster cluster, com.couchbase.client.java.Bucket bucket, com.landawn.abacus.util.SQLMapper sqlMapper)
cluster
- the clusterbucket
- the bucketsqlMapper
- the sql mapperpublic CouchbaseExecutor(com.couchbase.client.java.Cluster cluster, com.couchbase.client.java.Bucket bucket, com.landawn.abacus.util.SQLMapper sqlMapper, com.landawn.abacus.util.AsyncExecutor asyncExecutor)
cluster
- the clusterbucket
- the bucketsqlMapper
- the sql mapperasyncExecutor
- the async executorpublic com.couchbase.client.java.Cluster cluster()
public com.couchbase.client.java.Bucket bucket()
public static void registerIdProperty(Class<?> cls, String idPropertyName)
cls
- the clsidPropertyName
- the id property namepublic static com.landawn.abacus.DataSet extractData(com.couchbase.client.java.query.N1qlQueryResult resultSet)
resultSet
- the result setpublic static com.landawn.abacus.DataSet extractData(Class<?> targetClass, com.couchbase.client.java.query.N1qlQueryResult resultSet)
targetClass
- an entity class with getter/setter method or Map.class
resultSet
- the result setpublic static <T> List<T> toList(Class<T> targetClass, com.couchbase.client.java.query.N1qlQueryResult resultSet)
T
- the generic typetargetClass
- an entity class with getter/setter method, Map.class
or basic single value type(Primitive/String/Date...)resultSet
- the result setpublic static <T> T toEntity(Class<T> targetClass, com.couchbase.client.java.query.N1qlQueryRow row)
T
- the generic typetargetClass
- an entity class with getter/setter method or Map.class
row
- the rowpublic static <T> T toEntity(Class<T> targetClass, com.couchbase.client.java.document.JsonDocument jsonDocument)
jsonDocument
will be set to the returned object if and only if the id is not null or empty and the content in jsonDocument
doesn't contain any "id" property, and it's acceptable to the targetClass
.T
- the generic typetargetClass
- an entity class with getter/setter method or Map.class
jsonDocument
- the json documentpublic static <T> T toEntity(Class<T> targetClass, com.couchbase.client.java.document.json.JsonObject jsonObject)
T
- the generic typetargetClass
- an entity class with getter/setter method or Map.class
jsonObject
- the json objectpublic static String toJSON(com.couchbase.client.java.document.json.JsonArray jsonArray)
jsonArray
- the json arraypublic static String toJSON(com.couchbase.client.java.document.json.JsonObject jsonObject)
jsonObject
- the json objectpublic static String toJSON(com.couchbase.client.java.document.JsonDocument jsonDocument)
jsonDocument
- the json documentpublic static <T> T fromJSON(Class<T> targetClass, String json)
T
- the generic typetargetClass
- JsonArray.class
, JsonObject.class
or JsonDocument.class
json
- the jsonpublic static com.couchbase.client.java.document.json.JsonObject toJsonObject(Object obj)
obj
- an array of pairs of property name and value, or Map@SafeVarargs public static com.couchbase.client.java.document.json.JsonObject toJsonObject(Object... a)
a
- the apublic static com.couchbase.client.java.document.json.JsonArray toJsonArray(Object obj)
obj
- the obj@SafeVarargs public static com.couchbase.client.java.document.json.JsonArray toJsonArray(Object... a)
a
- the apublic static com.couchbase.client.java.document.JsonDocument toJsonDocument(Object obj)
obj
.obj
- an array of pairs of property name and value, or MapIllegalArgumentException
- if the specified obj
doesn't have any "id" property.@SafeVarargs public static com.couchbase.client.java.document.JsonDocument toJsonDocument(Object... a)
a
.a
- pairs of property name and value.IllegalArgumentException
- if the specified a
doesn't have any "id" property.public static String idNameOf(String bucketName)
bucketName
- the bucket namepublic com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument> get(String id)
id
- the idBucket.get(String)
public com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument> get(String id, long timeout, TimeUnit timeUnit)
id
- the idtimeout
- the timeouttimeUnit
- the time unitBucket.get(String, long, TimeUnit)
public <T> com.landawn.abacus.util.u.Optional<T> get(Class<T> targetClass, String id)
T
- the generic typetargetClass
- the target classid
- the idBucket.get(String, Class)
public <T> com.landawn.abacus.util.u.Optional<T> get(Class<T> targetClass, String id, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classid
- the idtimeout
- the timeouttimeUnit
- the time unitBucket.get(String, Class, long, TimeUnit)
public com.couchbase.client.java.document.JsonDocument gett(String id)
id
- the idBucket.get(String)
public com.couchbase.client.java.document.JsonDocument gett(String id, long timeout, TimeUnit timeUnit)
id
- the idtimeout
- the timeouttimeUnit
- the time unitBucket.get(String, long, TimeUnit)
public <T> T gett(Class<T> targetClass, String id)
T
- the generic typetargetClass
- the target classid
- the idBucket.get(String, Class)
public <T> T gett(Class<T> targetClass, String id, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classid
- the idtimeout
- the timeouttimeUnit
- the time unitBucket.get(String, Class, long, TimeUnit)
@SafeVarargs public final <T> com.landawn.abacus.util.u.Optional<T> findFirst(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final <T> List<T> list(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- an entity class with getter/setter method, Map.class
or basic single value type(Primitive/String/Date...)query
- the queryparameters
- the parameters@SafeVarargs public final boolean exists(String query, Object... parameters)
LIMIT 1
" in the sql statement for better performance.query
- the queryparameters
- the parameters@Deprecated @SafeVarargs public final long count(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalChar queryForChar(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalByte queryForByte(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalShort queryForShort(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalInt queryForInt(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalLong queryForLong(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalFloat queryForFloat(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.OptionalDouble queryForDouble(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.Nullable<String> queryForString(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final com.landawn.abacus.util.u.Nullable<Date> queryForDate(String query, Object... parameters)
query
- the queryparameters
- the parameters@Beta @SafeVarargs public final <T extends Date> com.landawn.abacus.util.u.Nullable<T> queryForDate(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final <V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<V> targetClass, String query, Object... parameters)
V
- the value typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.DataSet query(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.DataSet query(Class<?> targetClass, String query, Object... parameters)
targetClass
- the target classquery
- the queryparameters
- the parameterspublic com.landawn.abacus.DataSet query(com.couchbase.client.java.query.N1qlQuery query)
query
- the querypublic com.landawn.abacus.DataSet query(Class<?> targetClass, com.couchbase.client.java.query.N1qlQuery query)
targetClass
- the target classquery
- the querypublic com.landawn.abacus.DataSet query(com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
query
- the querytimeout
- the timeouttimeUnit
- the time unitpublic com.landawn.abacus.DataSet query(Class<?> targetClass, com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
targetClass
- the target classquery
- the querytimeout
- the timeouttimeUnit
- the time unit@SafeVarargs public final com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject> stream(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameterspublic com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject> stream(com.couchbase.client.java.query.N1qlQuery query)
query
- the querypublic <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, com.couchbase.client.java.query.N1qlQuery query)
T
- the generic typetargetClass
- the target classquery
- the querypublic com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject> stream(com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
query
- the querytimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.stream.Stream<T> stream(Class<T> targetClass, com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classquery
- the querytimeout
- the timeouttimeUnit
- the time unitpublic <T> T insert(T document)
T
- the generic typedocument
- the documentBucket.insert(Document)
public <T> T insert(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitBucket.insert(Document, long, TimeUnit)
public <T> T upsert(T document)
T
- the generic typedocument
- the documentBucket.upsert(Document)
public <T> T upsert(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitBucket.upsert(Document, long, TimeUnit)
public <T> T replace(T document)
T
- the generic typedocument
- the documentBucket.replace(Document)
public <T> T replace(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitBucket.replace(Document, long, TimeUnit)
public com.couchbase.client.java.document.JsonDocument remove(String id)
id
- the idBucket.remove(String)
public com.couchbase.client.java.document.JsonDocument remove(String id, long timeout, TimeUnit timeUnit)
id
- the idtimeout
- the timeouttimeUnit
- the time unitBucket.remove(String, long, TimeUnit)
public <T> T remove(Class<T> targetClass, String id)
T
- the generic typetargetClass
- the target classid
- the idBucket.remove(String, Class)
public <T> T remove(Class<T> targetClass, String id, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classid
- the idtimeout
- the timeouttimeUnit
- the time unitBucket.remove(String, Class, long, TimeUnit)
public <T> T remove(T document)
T
- the generic typedocument
- the documentBucket.remove(Document)
public <T> T remove(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitBucket.remove(Document, long, TimeUnit)
public com.couchbase.client.java.query.N1qlQueryResult execute(String query)
query
- the query@SafeVarargs public final com.couchbase.client.java.query.N1qlQueryResult execute(String query, Object... parameters)
query
- the queryparameters
- the parameterspublic com.couchbase.client.java.query.N1qlQueryResult execute(com.couchbase.client.java.query.N1qlQuery query)
query
- the querypublic com.couchbase.client.java.query.N1qlQueryResult execute(com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
query
- the querytimeout
- the timeouttimeUnit
- the time unitpublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument>> asyncGet(String id)
id
- the idpublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<com.couchbase.client.java.document.JsonDocument>> asyncGet(String id, long timeout, TimeUnit timeUnit)
id
- the idtimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<T>> asyncGet(Class<T> targetClass, String id)
T
- the generic typetargetClass
- the target classid
- the idpublic <T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<T>> asyncGet(Class<T> targetClass, String id, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classid
- the idtimeout
- the timeouttimeUnit
- the time unitpublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> asyncGett(String id)
id
- the idpublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> asyncGett(String id, long timeout, TimeUnit timeUnit)
id
- the idtimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncGett(Class<T> targetClass, String id)
T
- the generic typetargetClass
- the target classid
- the idpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncGett(Class<T> targetClass, String id, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classid
- the idtimeout
- the timeouttimeUnit
- the time unit@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<Boolean> asyncExists(String query, Object... parameters)
LIMIT 1
" in the sql statement for better performance.query
- the queryparameters
- the parameters@Deprecated @SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<Long> asyncCount(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalBoolean> asyncQueryForBoolean(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalChar> asyncQueryForChar(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalByte> asyncQueryForByte(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalShort> asyncQueryForShort(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalInt> asyncQueryForInt(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalLong> asyncQueryForLong(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalFloat> asyncQueryForFloat(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.OptionalDouble> asyncQueryForDouble(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<String>> asyncQueryForString(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<Date>> asyncQueryForDate(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final <T extends Date> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<T>> asyncQueryForDate(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final <V> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Nullable<V>> asyncQueryForSingleResult(Class<V> targetClass, String query, Object... parameters)
V
- the value typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final <T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<T>> asyncFindFirst(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final <T> com.landawn.abacus.util.ContinuableFuture<List<T>> asyncList(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> asyncQuery(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> asyncQuery(Class<?> targetClass, String query, Object... parameters)
targetClass
- the target classquery
- the queryparameters
- the parameterspublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> asyncQuery(com.couchbase.client.java.query.N1qlQuery query)
query
- the querypublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> asyncQuery(Class<?> targetClass, com.couchbase.client.java.query.N1qlQuery query)
targetClass
- the target classquery
- the querypublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> asyncQuery(com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
query
- the querytimeout
- the timeouttimeUnit
- the time unitpublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.DataSet> asyncQuery(Class<?> targetClass, com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
targetClass
- the target classquery
- the querytimeout
- the timeouttimeUnit
- the time unit@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject>> asyncStream(String query, Object... parameters)
query
- the queryparameters
- the parameters@SafeVarargs public final <T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<T>> asyncStream(Class<T> targetClass, String query, Object... parameters)
T
- the generic typetargetClass
- the target classquery
- the queryparameters
- the parameterspublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject>> asyncStream(com.couchbase.client.java.query.N1qlQuery query)
query
- the querypublic <T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<T>> asyncStream(Class<T> targetClass, com.couchbase.client.java.query.N1qlQuery query)
T
- the generic typetargetClass
- the target classquery
- the querypublic com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<com.couchbase.client.java.document.json.JsonObject>> asyncStream(com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
query
- the querytimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.stream.Stream<T>> asyncStream(Class<T> targetClass, com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classquery
- the querytimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncInsert(T document)
T
- the generic typedocument
- the documentpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncInsert(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncUpsert(T document)
T
- the generic typedocument
- the documentpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncUpsert(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncReplace(T document)
T
- the generic typedocument
- the documentpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncReplace(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitpublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> asyncRemove(String id)
id
- the idpublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.document.JsonDocument> asyncRemove(String id, long timeout, TimeUnit timeUnit)
id
- the idtimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncRemove(Class<T> targetClass, String id)
T
- the generic typetargetClass
- the target classid
- the idpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncRemove(Class<T> targetClass, String id, long timeout, TimeUnit timeUnit)
T
- the generic typetargetClass
- the target classid
- the idtimeout
- the timeouttimeUnit
- the time unitpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncRemove(T document)
T
- the generic typedocument
- the documentpublic <T> com.landawn.abacus.util.ContinuableFuture<T> asyncRemove(T document, long timeout, TimeUnit timeUnit)
T
- the generic typedocument
- the documenttimeout
- the timeouttimeUnit
- the time unitpublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> asyncExecute(String query)
query
- the query@SafeVarargs public final com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> asyncExecute(String query, Object... parameters)
query
- the queryparameters
- the parameterspublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> asyncExecute(com.couchbase.client.java.query.N1qlQuery query)
query
- the querypublic com.landawn.abacus.util.ContinuableFuture<com.couchbase.client.java.query.N1qlQueryResult> asyncExecute(com.couchbase.client.java.query.N1qlQuery query, long timeout, TimeUnit timeUnit)
query
- the querytimeout
- the timeouttimeUnit
- the time unitpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- Signals that an I/O exception has occurred.Copyright © 2019. All rights reserved.