Search in sources :

Example 6 with IdPrefixQuery

use of com.baidu.hugegraph.backend.query.IdPrefixQuery in project incubator-hugegraph by apache.

the class QueryTest method testToStringOfIdPrefixQuery.

@Test
public void testToStringOfIdPrefixQuery() {
    IdPrefixQuery query = new IdPrefixQuery(HugeType.EDGE, IdGenerator.of(1));
    query.limit(5L);
    Assert.assertEquals("`Query * from EDGE limit 5 where id prefix " + "with 1`", query.toString());
    query = new IdPrefixQuery(query, IdGenerator.of(12), IdGenerator.of(1));
    Assert.assertEquals("`Query * from EDGE limit 5 where id prefix " + "with 1 and start with 12(inclusive)`", query.toString());
    query = new IdPrefixQuery(query, IdGenerator.of(12), false, IdGenerator.of(1));
    Assert.assertEquals("`Query * from EDGE limit 5 where id prefix " + "with 1 and start with 12(exclusive)`", query.toString());
}
Also used : IdPrefixQuery(com.baidu.hugegraph.backend.query.IdPrefixQuery) Test(org.junit.Test)

Aggregations

IdPrefixQuery (com.baidu.hugegraph.backend.query.IdPrefixQuery)6 IdRangeQuery (com.baidu.hugegraph.backend.query.IdRangeQuery)5 Id (com.baidu.hugegraph.backend.id.Id)4 EdgeId (com.baidu.hugegraph.backend.id.EdgeId)3 Condition (com.baidu.hugegraph.backend.query.Condition)3 RangeConditions (com.baidu.hugegraph.backend.query.Condition.RangeConditions)3 BinaryId (com.baidu.hugegraph.backend.serializer.BinaryBackendEntry.BinaryId)3 ConditionQuery (com.baidu.hugegraph.backend.query.ConditionQuery)2 Directions (com.baidu.hugegraph.type.define.Directions)2 Query (com.baidu.hugegraph.backend.query.Query)1 TextBackendEntry (com.baidu.hugegraph.backend.serializer.TextBackendEntry)1 BackendEntry (com.baidu.hugegraph.backend.store.BackendEntry)1 NotSupportException (com.baidu.hugegraph.exception.NotSupportException)1 HugeType (com.baidu.hugegraph.type.HugeType)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1