Search in sources :

Example 11 with OCommandRequest

use of com.orientechnologies.orient.core.command.OCommandRequest in project orientdb by orientechnologies.

the class OIndexRemote method contains.

public boolean contains(final Object iKey) {
    final OCommandRequest cmd = formatCommand(QUERY_CONTAINS, name);
    final List<ODocument> result = getDatabase().command(cmd).execute(iKey);
    return (Long) result.get(0).field("size") > 0;
}
Also used : OCommandRequest(com.orientechnologies.orient.core.command.OCommandRequest) ODocument(com.orientechnologies.orient.core.record.impl.ODocument)

Example 12 with OCommandRequest

use of com.orientechnologies.orient.core.command.OCommandRequest in project orientdb by orientechnologies.

the class OIndexRemote method delete.

public OIndexRemote<T> delete() {
    final OCommandRequest cmd = formatCommand(QUERY_DROP, name);
    getDatabase().command(cmd).execute();
    return this;
}
Also used : OCommandRequest(com.orientechnologies.orient.core.command.OCommandRequest)

Example 13 with OCommandRequest

use of com.orientechnologies.orient.core.command.OCommandRequest in project orientdb by orientechnologies.

the class OIndexRemote method getSize.

public long getSize() {
    final OCommandRequest cmd = formatCommand(QUERY_SIZE, name);
    final List<ODocument> result = getDatabase().command(cmd).execute();
    return (Long) result.get(0).field("size");
}
Also used : OCommandRequest(com.orientechnologies.orient.core.command.OCommandRequest) ODocument(com.orientechnologies.orient.core.record.impl.ODocument)

Example 14 with OCommandRequest

use of com.orientechnologies.orient.core.command.OCommandRequest in project orientdb by orientechnologies.

the class OIndexRemote method count.

public long count(final Object iRangeFrom, final boolean iFromInclusive, final Object iRangeTo, final boolean iToInclusive, final int maxValuesToFetch) {
    final StringBuilder query = new StringBuilder(QUERY_COUNT_RANGE);
    if (iFromInclusive)
        query.append(QUERY_GET_VALUES_BEETWEN_INCLUSIVE_FROM_CONDITION);
    else
        query.append(QUERY_GET_VALUES_BEETWEN_EXCLUSIVE_FROM_CONDITION);
    query.append(QUERY_GET_VALUES_AND_OPERATOR);
    if (iToInclusive)
        query.append(QUERY_GET_VALUES_BEETWEN_INCLUSIVE_TO_CONDITION);
    else
        query.append(QUERY_GET_VALUES_BEETWEN_EXCLUSIVE_TO_CONDITION);
    if (maxValuesToFetch > 0)
        query.append(QUERY_GET_VALUES_LIMIT).append(maxValuesToFetch);
    final OCommandRequest cmd = formatCommand(query.toString());
    return (Long) getDatabase().command(cmd).execute(iRangeFrom, iRangeTo);
}
Also used : OCommandRequest(com.orientechnologies.orient.core.command.OCommandRequest)

Example 15 with OCommandRequest

use of com.orientechnologies.orient.core.command.OCommandRequest in project orientdb by orientechnologies.

the class OIndexRemote method count.

public long count(final Object iKey) {
    final OCommandRequest cmd = formatCommand(QUERY_COUNT, name);
    final List<ODocument> result = getDatabase().command(cmd).execute(iKey);
    return (Long) result.get(0).field("size");
}
Also used : OCommandRequest(com.orientechnologies.orient.core.command.OCommandRequest) ODocument(com.orientechnologies.orient.core.record.impl.ODocument)

Aggregations

OCommandRequest (com.orientechnologies.orient.core.command.OCommandRequest)21 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)12 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)7 OCommandScript (com.orientechnologies.orient.core.command.script.OCommandScript)2 Collection (java.util.Collection)2 LinkedHashMap (java.util.LinkedHashMap)2 ORecord (com.orientechnologies.orient.core.record.ORecord)1 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)1 OCommandGremlin (com.orientechnologies.orient.graph.gremlin.OCommandGremlin)1