本文整理匯總了Java中com.rethinkdb.model.OptArgs類的典型用法代碼示例。如果您正苦於以下問題:Java OptArgs類的具體用法?Java OptArgs怎麽用?Java OptArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OptArgs類屬於com.rethinkdb.model包,在下文中一共展示了OptArgs類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
public <T> T execute(ReqlExpr expr, OptArgs optArgs) {
try (Connection conn = pool.getConnection()) {
if (optArgs != null && !optArgs.isEmpty()) {
return expr.run(conn, optArgs);
} else {
return expr.run(conn);
}
}
}
示例2: executeCursor
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
public <T> T executeCursor(ReqlExpr expr, OptArgs optArgs, Function<Cursor, T> call) {
try (Connection conn = pool.getConnection()) {
Cursor<T> cursor = null;
if (optArgs != null && !optArgs.isEmpty()) {
cursor = expr.run(conn, optArgs);
} else {
cursor = expr.run(conn);
}
T result = call.apply(cursor);
cursor.close();
return result;
}
}
示例3: run
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
@Override
public <T, P> T run(ReqlAst term, OptArgs globalOpts, Optional<Class<P>> pojoClass) {
checkOpen();
return wrapped.run(term, globalOpts, pojoClass);
}
示例4: runNoReply
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
@Override
public void runNoReply(ReqlAst term, OptArgs globalOpts) {
checkOpen();
wrapped.runNoReply(term, globalOpts);
}
示例5: ReqlGeo
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
protected ReqlGeo(TermType termType, Arguments args, OptArgs optargs) {
super(termType, args, optargs);
geoClassName = getClass().getName();
}
示例6: toJsonString
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
private String toJsonString(ReqlExpr expr) throws UnsupportedEncodingException {
Query q = Query.start(0L, expr, new OptArgs());
return new String(q.serialize().array(), "UTF-8");
}
示例7: updateNonAtomic
import com.rethinkdb.model.OptArgs; //導入依賴的package包/類
/**
* Updates a model in the non atomic way. See <a href="https://rethinkdb.com/api/java/update/">ReQL command: update</a>
* for more details.
*
* @param id The id of the model which should be updated.
* @param model The model which should be updated.
*/
public void updateNonAtomic(PK id, T model) {
try (Connection connection = connectionProvider.get()) {
R.table(tableName).get(id).update(model).run(connection, OptArgs.of("non_atomic", true));
}
}