Skip to content

Conversation

@xterao
Copy link
Collaborator

@xterao xterao commented Sep 12, 2025

Problem
When specifying properties in the include/exclude annotation options for a DAO parameter’s Entity class, properties defined in a parent class were incorrectly highlighted as errors.

Relation
#453

Solution

  • Updated the logic to use allFields, allowing retrieval of properties defined in parent classes.
  • Added validation so that only properties defined in Entity classes are considered valid when matching property names.
  • Adjusted error messages to clarify that only properties defined in Entity classes or Embeddable classes are valid options for annotation parameters.

Impact
This fix ensures that annotation option checks properly follow Entity inheritance, preventing false error highlights and improving accuracy when working with inherited properties.

@xterao xterao requested a review from Copilot September 12, 2025 09:08
@xterao xterao self-assigned this Sep 12, 2025
@xterao xterao linked an issue Sep 12, 2025 that may be closed by this pull request
@xterao xterao added this to the 2.3.0 Release milestone Sep 12, 2025
@github-actions github-actions bot added the fix Bug fixes label Sep 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes annotation option validation in DAO parameters to properly respect Entity inheritance. The fix addresses an issue where properties defined in parent Entity classes were incorrectly flagged as errors when specified in include/exclude annotation options.

  • Updated validation logic to use allFields instead of fields to access inherited properties
  • Added filtering to only consider properties from Entity or Embeddable classes as valid options
  • Enhanced test coverage with inheritance hierarchy test cases

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
DaoAnnotationOptionParameterCheckProcessor.kt Core validation logic updated to handle inheritance and filter by Entity/Embeddable types
TypeUtil.kt Minor cleanup removing redundant boolean comparison
PsiPatternUtil.kt Variable declaration optimization
CLAUDE.md Added guidance on using allFields/allMethods for inheritance support
.claude/guidelines/TEST_CASE_GUIDELINE.md Enhanced test guidelines for Entity inheritance scenarios
Test entities Added comprehensive Entity inheritance hierarchy test cases
Test DAOs Added validation test cases for inherited properties
AnnotationOptionParameterInspectionTest.kt New test class structure for manual validation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@xterao xterao merged commit 71fffd6 into main Sep 16, 2025
5 checks passed
@xterao xterao deleted the fix/annotation-option-check-when-using-a-parent-property branch September 16, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in annotation option check when using a parent property

2 participants