本文整理汇总了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));
}
}