Enhance annotation option parameter validation for embedded properties #368
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.
Summary
This PR enhances the validation logic for annotation option parameters (
include/exclude) in DAO methods to properly handle embedded properties. The validation now provides better error messages and correctly validates nested property paths including embedded types.Changes
Core Improvements
Enhanced Validation for Embedded Properties
@Embeddabletypeinclude/excludeoptionsImproved Error Messaging
ValidationAnnotationOptionEmbeddableResultfor embeddable-specific errorsExtended Annotation Coverage
@Update,@BatchUpdate,@Insert,@BatchInsert, and@MultiInsertannotationsreturningoption validation with nestedinclude/excludepropertiesTechnical Details
Modified Files:
DaoAnnotationOptionParameterCheckProcessor.kt- Core validation logic enhancementsDaoAnnotationOptionParameterInspectionVisitor.kt- Added support for Insert annotationsTest Coverage:
Testing
All existing tests pass with the enhanced validation. The changes are backward compatible and don't affect existing functionality while providing better developer experience through improved error messages.
Related Issues
This change improves the developer experience when working with Doma's entity include/exclude options, particularly for projects using embedded properties extensively.