core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLTruncateRecord.java
public Object execute(final Map<Object, Object> iArgs) {
    if (records.isEmpty())
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    int deleted = 0;

    final ODatabaseDocumentInternal database = getDatabase();
    for (String rec : records) {
      try {
        final ORecordId rid = new ORecordId(rec);
        final OStorageOperationResult<Boolean> result = database.getStorage().deleteRecord(rid, -1, 0, null);
        database.getLocalCache().deleteRecord(rid);

        if (result.getResult())
          deleted++;

      } catch (Exception e) {
        throw OException.wrapException(new OCommandExecutionException("Error on executing command"), e);
      }
    }

    return deleted;
  }
public Object execute(final Map<Object, Object> iArgs) {
    if (records.isEmpty())
      throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet");

    int deleted = 0;

    final ODatabaseDocumentInternal database = getDatabase();
    for (String rec : records) {
      try {
        final ORecordId rid = new ORecordId(rec);
        final OStorageOperationResult<Boolean> result = database.getStorage().deleteRecord(rid, -1, 0, null);
        database.getLocalCache().deleteRecord(rid);

        if (result.getResult())
          deleted++;

      } catch (Exception e) {
        throw OException.wrapException(new OCommandExecutionException("Error on executing command"), e);
      }
    }

    return deleted;
  }
public Object execute ( final Map < Object , Object > iArgs ) { if ( records . isEmpty ( ) ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; int deleted = 0 ; final ODatabaseDocumentInternal database = getDatabase ( ) ; for ( String rec : records ) { try { final ORecordId rid = new ORecordId ( rec ) ; final OStorageOperationResult < Boolean > result = database . getStorage ( ) . deleteRecord ( rid , - 1 , 0 , null ) ; database . getLocalCache ( ) . deleteRecord ( rid ) ; if ( result . getResult ( ) ) deleted ++ ; } catch ( Exception e ) { throw OException . wrapException ( new OCommandExecutionException ( "Error on executing command" ) , e ) ; } } return deleted ; }
Execute the command.
Execute the command .