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:
@ -86,6 +86,7 @@ public class DeleteAction
|
|||||||
QFieldMetaData primaryKeyField = table.getField(primaryKeyFieldName);
|
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)
|
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."));
|
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);
|
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) //
|
// 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