mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Reset the input list of primary keys - callers may expect that!
This commit is contained in:
@ -85,7 +85,8 @@ public class DeleteAction
|
||||
String primaryKeyFieldName = table.getPrimaryKeyField();
|
||||
QFieldMetaData primaryKeyField = table.getField(primaryKeyFieldName);
|
||||
|
||||
List<Serializable> primaryKeys = deleteInput.getPrimaryKeys();
|
||||
List<Serializable> primaryKeys = deleteInput.getPrimaryKeys();
|
||||
List<Serializable> originalPrimaryKeys = primaryKeys == null ? null : new ArrayList<>(primaryKeys);
|
||||
if(CollectionUtils.nullSafeHasContents(primaryKeys) && deleteInput.getQueryFilter() != null)
|
||||
{
|
||||
throw (new QException("A delete request may not contain both a list of primary keys and a query filter."));
|
||||
@ -173,6 +174,11 @@ public class DeleteAction
|
||||
////////////////////////////////////
|
||||
DeleteOutput deleteOutput = deleteInterface.execute(deleteInput);
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// reset the input's list of primary keys -- callers may use & expect that to be what they had passed in!! //
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
deleteInput.setPrimaryKeys(originalPrimaryKeys);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// merge the backend's output with any validation errors we found (whose pkeys wouldn't have gotten into the backend delete) //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user