Community
Participate
Working Groups
Copied from bug 353017 since the bug is actually in the Hermes parser. Build Identifier: 20110615-0604 Validation tool shows problems in named queries which have subquery in where clause. Example: @Entity @Table(name="test_table") @NamedQuery(name = "TestEntity.testQuery", query = "select t from TestEntity t where t.id = (select max(tt.id) from TestEntity tt)") public class TestEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name = "id", unique = true, nullable = false) private Integer id; @Column(name="name", length=255) private String name; } Validation tool shows following errors: Multiple markers at this line - The identification variable 't' is not defined in the FROM clause. - The identification variable 't' is not defined in the FROM clause. - The identification variable 'tt' is not defined in the FROM clause. Reproducible: Always Steps to Reproduce: 1.Create entity class 2.Add javax.persistence.NamedQuery annotation to class with select query having subquery in where clause
Created attachment 200381 [details] Fix validating undeclared variables when a query has a subquery
Checked in the fix.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink