Publish entity update/delete events from the Java DAO (intent glue foundation) - #6049
Merged
Conversation
… DAO The generated <Entity>Repository already publishes the create event (Producer.sendToTopic to the entity's base topic). Mirror that proven pattern additively for update and delete so intent "reactions" glue (onUpdate/onDelete) has events to bind to: - update() is now always overridden: persist (incl. any calculated-on-update properties) then publish the full entity to "<project>-<perspective>-<name>-updated". - delete(entity) / deleteById(id) publish the full entity to "...-deleted" (deleteById loads the row first so the payload is complete). Create stays on the unsuffixed base topic, so the existing process-trigger listeners and IntentEngineIT are unaffected; update/delete use -updated/-deleted suffixes. Foundation for the declarative-glue catalog (see engine-intent CLAUDE.md "Planned: declarative glue"). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The generated
<Entity>Repository(Java DAO) already publishes the create event viaProducer.sendToTopic(...). This adds the update and delete events the same way, so the planned intent "reactions" glue (onUpdate/onDelete→ notify / call / …) has events to bind to.This is the one hard prerequisite for Tier 1 of the declarative-glue catalog (see
components/engine/engine-intent/CLAUDE.md→ "Planned: declarative glue").How (additive, mirrors the proven create pattern)
update()is now always overridden: persist (including any calculated-on-update properties, as before) then publish the full entity JSON to"<project>-<perspective>-<name>-updated".delete(entity)anddeleteById(id)publish the full entity to"...-deleted"(deleteByIdloads the row first so the payload is complete).Topic convention: create stays on the unsuffixed base topic (unchanged), update/delete use
-updated/-deletedsuffixes. So existing process-trigger listeners andIntentEngineITare unaffected — the change is purely additive. (The create asymmetry is intentional for back-compat; we can normalise later if desired.)Testing / caveat
Template-only change, mirroring the already-working create publication line-for-line. It is exercised at runtime only by a full "Generate from EDM → compile → run" cycle, which I could not boot cleanly in this environment; CI builds + runs the suite on H2/PostgreSQL/MSSQL. No consumer of the new topics exists yet (unconsumed topics simply drop messages), so this is safe to land ahead of the reaction generator.
🤖 Generated with Claude Code