mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
Don't try to manage associations of empty lists
This commit is contained in:
@ -369,6 +369,8 @@ public class DeleteAction
|
|||||||
QueryOutput queryOutput = new QueryAction().execute(queryInput);
|
QueryOutput queryOutput = new QueryAction().execute(queryInput);
|
||||||
List<Serializable> associatedKeys = queryOutput.getRecords().stream().map(r -> r.getValue(associatedTable.getPrimaryKeyField())).toList();
|
List<Serializable> associatedKeys = queryOutput.getRecords().stream().map(r -> r.getValue(associatedTable.getPrimaryKeyField())).toList();
|
||||||
|
|
||||||
|
if(CollectionUtils.nullSafeHasContents(associatedKeys))
|
||||||
|
{
|
||||||
DeleteInput nextLevelDeleteInput = new DeleteInput();
|
DeleteInput nextLevelDeleteInput = new DeleteInput();
|
||||||
nextLevelDeleteInput.setTransaction(deleteInput.getTransaction());
|
nextLevelDeleteInput.setTransaction(deleteInput.getTransaction());
|
||||||
nextLevelDeleteInput.setTableName(association.getAssociatedTableName());
|
nextLevelDeleteInput.setTableName(association.getAssociatedTableName());
|
||||||
@ -376,6 +378,7 @@ public class DeleteAction
|
|||||||
DeleteOutput nextLevelDeleteOutput = new DeleteAction().execute(nextLevelDeleteInput);
|
DeleteOutput nextLevelDeleteOutput = new DeleteAction().execute(nextLevelDeleteInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,6 +239,8 @@ public class InsertAction extends AbstractQActionFunction<InsertInput, InsertOut
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(CollectionUtils.nullSafeHasContents(nextLevelInserts))
|
||||||
|
{
|
||||||
InsertInput nextLevelInsertInput = new InsertInput();
|
InsertInput nextLevelInsertInput = new InsertInput();
|
||||||
nextLevelInsertInput.setTransaction(transaction);
|
nextLevelInsertInput.setTransaction(transaction);
|
||||||
nextLevelInsertInput.setTableName(association.getAssociatedTableName());
|
nextLevelInsertInput.setTableName(association.getAssociatedTableName());
|
||||||
@ -246,6 +248,7 @@ public class InsertAction extends AbstractQActionFunction<InsertInput, InsertOut
|
|||||||
InsertOutput nextLevelInsertOutput = new InsertAction().execute(nextLevelInsertInput);
|
InsertOutput nextLevelInsertOutput = new InsertAction().execute(nextLevelInsertInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user