Repository navigation
fix(crud): 避免默认 ID 监听器覆盖平台事件分发器 - #388
Merged
Merged
Conversation
汇总 Feature 后显式注册平台分发器,保留完整实体事件链。 覆盖两种监听器注册顺序、具名 Feature 及回调次数,补充 updateById 部分更新与实体事件回归。
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.
扩展 EventListener 默认与平台 CompositeEventListener 使用相同 Feature ID。扩展被发现得更晚时,会覆盖数据库元数据中的平台分发器,导致实体事件链不再执行。
现在汇总 Feature 后通过限定名称注入并最后注册平台分发器,扩展监听器继续由分发器调用;具名 Feature 保持注册,回调只执行一次。配置工厂方法的注释同步说明默认事件 ID 的归属。databaseMetadata 工厂方法增加了分发器参数,Spring 自动按 Qualifier 注入;手动调用该方法的代码需提供此参数。
验证: