0

我需要从 ActivePivot 5.0 的存储中删除记录。

当我不知道这些记录的完整密钥时,如何实现这一点?

4

1 回答 1

2

这应该可以正常工作:

    try {
        datastore.getTransactionManager().startTransaction();
        datastore.getTransactionManager().removeWhere("storeName", BaseConditions.Equal("attribute", value));
        datastore.getTransactionManager().commitTransaction();
    } catch (DatastoreTransactionException e) {
        try {
            datastore.getTransactionManager().rollbackTransaction();
        } catch (DatastoreTransactionException re) {
            throw new QuartetRuntimeException("The transaction rollback has failed.", re);
        }
        throw new QuartetRuntimeException("The transaction commit has failed.", e);
    }
于 2014-09-04T13:59:56.377 回答