79797609

Date: 2025-10-23 09:30:25
Score: 1.5
Natty:
Report link

Finally found a workaround: The issue is the manually assigned Id of the Example Entity.

If the id field is null by default and the value generated by a sequence or other type of Generator then the event is triggered.

If it is necessary to assign the id manually one could implement Persistable and make the entity object itself define whether it's new or not.

Adjusted the example project to see all variants: https://github.com/thuri/spring-domain-events/commit/097904594f6cd83526b871d0599fd04e13a6cc0c

Reasons:
  • Contains signature (1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: thuri