Skip to content

Error in annotation option check when using a parent property #453

@xterao

Description

@xterao

Describe the bug
Fields specified in include/exclude are highlighted as errors when they are defined in the parent of the Entity class used as a DAO method parameter.

@Entity
public class SubEntity extends ParentEntity {

	Integer amount;

	String subName;
}

@Entity
public class ParentEntity {

	@Id
	Integer id;

	String name;

}
Image

Cause
When checking option fields, the code references fields from PsiClass#getFields, which returns only the fields declared directly in the class.

Fix approach
This issue does not occur in the bound-variable origin check.
Use PsiClass#getAllFields so that the field list also includes those defined in parent classes.

Desktop :

  • IDEA Version IntelliJ : 2025.2.1
  • Doma Tools Version : 2.2.1

Additional context

https://github.com/domaframework/doma-tools-for-intellij/blob/main/src/main/kotlin/org/domaframework/doma/intellij/inspection/dao/processor/option/DaoAnnotationOptionParameterCheckProcessor.kt#L118

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions