delete method
FutureOr<Iterable<O> >
delete(
- EntityMatcher<
O> matcher, { - Object? parameters,
- List? positionalParameters,
- Map<
String, Object?> ? namedParameters, - Transaction? transaction,
override
Implementation
@override
FutureOr<Iterable<O>> delete(EntityMatcher<O> matcher,
{Object? parameters,
List? positionalParameters,
Map<String, Object?>? namedParameters,
Transaction? transaction}) {
checkNotClosed();
var canPropagate =
hasReferencedEntities(resolveEntityResolutionRules(null));
var op = TransactionOperationDelete(
name, canPropagate, operationExecutor, matcher,
transaction: transaction);
try {
return repositoryAdapter.doDelete(op, matcher,
parameters: parameters,
positionalParameters: positionalParameters,
namedParameters: namedParameters, preFinish: (results) {
return resolveEntities(op.transaction, results)
.resolveMapped((entities) {
untrackEntities(entities, deleted: true);
return entities;
});
});
} catch (e, s) {
var message = 'delete> '
'matcher: $matcher ; '
'parameters: $parameters ; '
'positionalParameters: $positionalParameters ; '
'namedParameters: $namedParameters ; '
'op: $op';
_log.severe(message, e, s);
rethrow;
}
}