use of com.couchbase.client.java.query.Statement in project jnosql-diana-driver by eclipse.
the class CouchbaseDocumentCollectionManagerTest method shouldRunN1QlStatementParams.
@Test
public void shouldRunN1QlStatementParams() {
DocumentEntity entity = getEntity();
entityManager.insert(entity);
Statement statement = Select.select("*").from("jnosql").where(x("name").eq("$name"));
JsonObject params = JsonObject.create().put("name", "Poliana");
List<DocumentEntity> entities = entityManager.n1qlQuery(statement, params);
assertFalse(entities.isEmpty());
assertEquals(1, entities.size());
}
use of com.couchbase.client.java.query.Statement in project jnosql-diana-driver by eclipse.
the class CouchbaseDocumentCollectionManagerTest method shouldRunN1QlStatement.
@Test
public void shouldRunN1QlStatement() {
DocumentEntity entity = getEntity();
entityManager.insert(entity);
Statement statement = Select.select("*").from("jnosql").where(x("name").eq("\"Poliana\""));
List<DocumentEntity> entities = entityManager.n1qlQuery(statement);
assertFalse(entities.isEmpty());
assertEquals(1, entities.size());
}
Aggregations