Skip to content

Publish entity update/delete events from the Java DAO (intent glue foundation) - #6049

Merged
delchev merged 1 commit into
masterfrom
intent-glue-entity-events
Jun 19, 2026
Merged

Publish entity update/delete events from the Java DAO (intent glue foundation)#6049
delchev merged 1 commit into
masterfrom
intent-glue-entity-events

Conversation

@delchev

@delchev delchev commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

The generated <Entity>Repository (Java DAO) already publishes the create event via Producer.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) and deleteById(id) publish the full entity to "...-deleted" (deleteById loads the row first so the payload is complete).

Topic convention: create stays on the unsuffixed base topic (unchanged), update/delete use -updated / -deleted suffixes. So existing process-trigger listeners and IntentEngineIT are 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

… 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>
@delchev
delchev merged commit b5a6e7f into master Jun 19, 2026
12 checks passed
@delchev
delchev deleted the intent-glue-entity-events branch June 19, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant