@CheckHQL is reporting error when named query contains valid Java constant

Description

Java constant in named query are not recognized as valid during meta model generation. If @CheckHQL annotation is present,, processing will result in error. Otherwise, warning will be issued.

Reason for this problem is in methodorg.hibernate.query.hql.internal.BasicDotIdentifierConsumer.BaseLocalSequencePart#resolvePathPart

 

Here class loader still does not have all classes loaded and will return null and throw SemanticException.

 

Test case for this issue is not simple to create because existing CompilationTest is inheriting classpath .

 

Minimal example to reproduce this problem is created on github

Activity

Gavin KingMay 22, 2024 at 4:42 PM

Fixed by Čedomir.

Thanks!

Čedomir IgalyMay 14, 2024 at 4:17 PM

One possible solution is suggested in PR 8374

Čedomir IgalyMay 14, 2024 at 9:22 AM

Managed to create test case showing the probem PR 8374

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created May 13, 2024 at 5:33 PM
Updated June 14, 2024 at 3:08 PM
Resolved May 22, 2024 at 4:42 PM