File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
main/java/com/arangodb/springframework/repository
test/java/com/arangodb/springframework/repository Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 29
29
import com .arangodb .springframework .core .util .AqlUtils ;
30
30
import org .slf4j .Logger ;
31
31
import org .slf4j .LoggerFactory ;
32
+ import org .springframework .dao .InvalidDataAccessResourceUsageException ;
32
33
import org .springframework .data .domain .*;
33
34
import org .springframework .data .mapping .PersistentPropertyAccessor ;
34
35
import org .springframework .data .repository .query .FluentQuery ;
@@ -155,7 +156,11 @@ public long count() {
155
156
*/
156
157
@ Override
157
158
public void deleteById (final ID id ) {
158
- arangoOperations .delete (id , domainClass );
159
+ try {
160
+ arangoOperations .delete (id , domainClass );
161
+ } catch (InvalidDataAccessResourceUsageException notFound ) {
162
+ // ignored by contract
163
+ }
159
164
}
160
165
161
166
/**
Original file line number Diff line number Diff line change 4
4
import static org .hamcrest .Matchers .equalTo ;
5
5
import static org .hamcrest .Matchers .is ;
6
6
7
- import java .util .ArrayList ;
8
- import java .util .Arrays ;
9
- import java .util .LinkedList ;
10
- import java .util .List ;
11
- import java .util .Optional ;
7
+ import java .util .*;
12
8
13
9
import org .junit .jupiter .api .Test ;
14
10
import org .springframework .data .domain .*;
@@ -90,6 +86,7 @@ public void deleteByIdTest() {
90
86
repository .deleteById (johnId );
91
87
assertThat (repository .existsById (bob .getId ()), equalTo (true ));
92
88
assertThat (repository .existsById (johnId ), equalTo (false ));
89
+ repository .deleteById ("12345678" );
93
90
}
94
91
95
92
@ Test
You can’t perform that action at this time.
0 commit comments