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;
}
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;
}
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");
}
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);
}
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");
}
Aggregations