我需要从 ActivePivot 5.0 的存储中删除记录。
当我不知道这些记录的完整密钥时,如何实现这一点?
这应该可以正常工作:
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);
}