Skip to content

Commit 6c4989c

Browse files
committed
Add fallback for parent class name retrieval in validation property result
1 parent dd18e42 commit 6c4989c

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/main/kotlin/org/domaframework/doma/intellij/common/sql/validator/result/ValidationPropertyResult.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class ValidationPropertyResult(
4040
val parentName =
4141
parentClass?.clazz?.name
4242
?: (parentClass?.type as? PsiClassType)?.name
43+
?: parentClass?.type?.canonicalText
4344
?: ""
4445
holder.registerProblem(
4546
identify,

src/test/testData/src/main/resources/META-INF/doma/example/dao/EmployeeSummaryDao/bindVariableForEntityAndNonEntityParentClass.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ INSERT INTO employee_project (employee_name, department, project)
1111
AND e1.user_dept = /*# "development" */'dev'
1212
-- Access to parent private field
1313
WHERE u1.user_name = /* employee.userName.toLowerCase() */'name'
14+
OR u1.name = /* employee.userName.isBlank().<error descr="The field or method [x] does not exist in the class [boolean]">x</error> */'boolean'
1415
-- Access to non-existent parent field
1516
OR u1.user_name = /* employee.<error descr="The field or method [userFirstName] does not exist in the class [Employee]">userFirstName</error>.toLowerCase() */'name'
1617
-- Public parent method

0 commit comments

Comments
 (0)