Skip to content

Commit

Permalink
Merge pull request #86 from cardano-foundation/fix/tx_item_update_fail
Browse files Browse the repository at this point in the history
fix: transaction items update
  • Loading branch information
M4rc0Russ0 authored Nov 14, 2024
2 parents b0ac608 + 00fa66b commit c28cc28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public class TransactionEntity extends CommonEntity implements Persistable<Strin
@Setter
private Boolean ledgerDispatchApproved = false;

@OneToMany(mappedBy = "transaction", orphanRemoval = true, fetch = EAGER)
@OneToMany(mappedBy = "transaction", orphanRemoval = true, fetch = EAGER, cascade = CascadeType.ALL)
private Set<TransactionItemEntity> items = new LinkedHashSet<>();

@OneToOne(fetch = FetchType.LAZY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ private void processTransactionsForTheFirstTime(String batchId,
val attached = txM.orElseThrow();

transactionConverter.copyFields(attached, incomingTx);

attached.getAllItems().clear();
attached.getAllItems().addAll(incomingTx.getAllItems());
toProcessTransactions.add(attached);
} else {
toProcessTransactions.add(incomingTx);
Expand Down

0 comments on commit c28cc28

Please sign in to comment.