DATACMNS-539 - DefaultCrudMethods now detects delete(T t) methods.
The CRUD method detection now also discovers delete methods taking the domain type as argument. Related ticket: DATAREST-319.
This commit is contained in:
@@ -103,7 +103,8 @@ class DefaultCrudMethods implements CrudMethods {
|
||||
@SuppressWarnings("unchecked")
|
||||
private Method selectMostSuitableDeleteMethod(RepositoryMetadata metadata) {
|
||||
|
||||
for (Class<?> type : Arrays.asList(metadata.getIdType(), Serializable.class, Iterable.class)) {
|
||||
for (Class<?> type : Arrays.asList(metadata.getDomainType(), metadata.getIdType(), Serializable.class,
|
||||
Iterable.class)) {
|
||||
Method candidate = findMethod(metadata.getRepositoryInterface(), DELETE, type);
|
||||
if (candidate != null) {
|
||||
return getMostSpecificMethod(candidate, metadata.getRepositoryInterface());
|
||||
|
||||
Reference in New Issue
Block a user