コード例 #1
0
ファイル: DataCursor.java プロジェクト: nologic/nabs
  /**
   * Binding version of Cursor.putNoDupData(), optionally returning the old value and optionally
   * using the current key instead of the key parameter.
   */
  OperationStatus putNoDupData(Object key, Object value, Object[] oldValue, boolean useCurrentKey)
      throws DatabaseException {

    initForPut(key, value, oldValue, useCurrentKey);
    if (view.dupsOrdered) {
      return cursor.putNoDupData(keyThang, valueThang);
    } else {
      if (view.dupsAllowed) {
        /* Unordered duplicates. */
        OperationStatus status =
            cursor.getSearchBoth(keyThang, primaryKeyThang, valueThang, getLockMode(false));
        if (status == OperationStatus.SUCCESS) {
          return OperationStatus.KEYEXIST;
        } else {
          return cursor.put(keyThang, valueThang);
        }
      } else {
        /* No duplicates. */
        return cursor.putNoOverwrite(keyThang, valueThang);
      }
    }
  }
コード例 #2
0
ファイル: DataCursor.java プロジェクト: nologic/nabs
  /**
   * Binding version of Cursor.putNoOverwrite(), optionally using the current key instead of the key
   * parameter.
   */
  OperationStatus putNoOverwrite(Object key, Object value, boolean useCurrentKey)
      throws DatabaseException {

    initForPut(key, value, null, useCurrentKey);
    return cursor.putNoOverwrite(keyThang, valueThang);
  }
コード例 #3
0
ファイル: DataCursor.java プロジェクト: nologic/nabs
  /**
   * Binding version of Cursor.put(), optionally returning the old value and optionally using the
   * current key instead of the key parameter.
   */
  OperationStatus put(Object key, Object value, Object[] oldValue, boolean useCurrentKey)
      throws DatabaseException {

    initForPut(key, value, oldValue, useCurrentKey);
    return cursor.put(keyThang, valueThang);
  }