NEW should be legal as a token in a state field path expression in JPQL.
A multi-node token that has NEW as one of its elements should work just fine in a JPQL query. See #3128
This commit is contained in:
@@ -602,6 +602,7 @@ identification_variable
|
||||
| INNER
|
||||
| KEY
|
||||
| LEFT
|
||||
| NEW
|
||||
| ORDER
|
||||
| OUTER
|
||||
| FLOOR
|
||||
|
||||
@@ -1584,4 +1584,20 @@ class HqlQueryRendererTests {
|
||||
order by CTM_UTLRAW_NLSSORT_LOWER(b.nome) ASC
|
||||
""");
|
||||
}
|
||||
|
||||
@Test // GH-3128
|
||||
void newShouldBeLegalAsPartOfAStateFieldPathExpression() {
|
||||
|
||||
assertQuery("""
|
||||
SELECT j
|
||||
FROM AgentUpdateTask j
|
||||
WHERE j.creationTimestamp < :date
|
||||
AND (j.status = com.ca.apm.acc.configserver.core.domain.jobs.AgentUpdateTaskStatus.NEW
|
||||
OR
|
||||
j.status = com.ca.apm.acc.configserver.core.domain.jobs.AgentUpdateTaskStatus.STARTED
|
||||
OR
|
||||
j.status = com.ca.apm.acc.configserver.core.domain.jobs.AgentUpdateTaskStatus.QUEUED)
|
||||
ORDER BY j.id
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -967,4 +967,20 @@ class JpqlQueryRendererTests {
|
||||
WHERE L.isLocked = FALSE OR L.forceUnlockTime < :time
|
||||
""");
|
||||
}
|
||||
|
||||
@Test // GH-3128
|
||||
void newShouldBeLegalAsPartOfAStateFieldPathExpression() {
|
||||
|
||||
assertQuery("""
|
||||
SELECT j
|
||||
FROM AgentUpdateTask j
|
||||
WHERE j.creationTimestamp < :date
|
||||
AND (j.status = com.ca.apm.acc.configserver.core.domain.jobs.AgentUpdateTaskStatus.NEW
|
||||
OR
|
||||
j.status = com.ca.apm.acc.configserver.core.domain.jobs.AgentUpdateTaskStatus.STARTED
|
||||
OR
|
||||
j.status = com.ca.apm.acc.configserver.core.domain.jobs.AgentUpdateTaskStatus.QUEUED)
|
||||
ORDER BY j.id
|
||||
""");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user