TYPE should be a valid attribute of an entity for a custom query.

See #3062, #3056.
This commit is contained in:
Greg L. Turnquist
2023-07-10 08:45:32 -05:00
parent 49ebc1ab0f
commit 56de051d6f
3 changed files with 15 additions and 0 deletions

View File

@@ -604,6 +604,7 @@ identification_variable
| OUTER
| FLOOR
| SIGN
| TYPE
| VALUE)
;

View File

@@ -1549,4 +1549,11 @@ class HqlQueryRendererTests {
void escapeClauseShouldWork() {
assertQuery("select t.name from SomeDbo t where t.name LIKE :name escape '\\\\'");
}
@Test // GH-3062, GH-3056
void typeShouldBeAValidParameter() {
assertQuery("select e from Employee e where e.type = :_type");
assertQuery("select te from TestEntity te where te.type = :type");
}
}

View File

@@ -941,4 +941,11 @@ class JpqlQueryRendererTests {
void queryWithValueShouldWork() {
assertQuery("select t.value from TestEntity t");
}
@Test // GH-3062, GH-3056
void typeShouldBeAValidParameter() {
assertQuery("select e from Employee e where e.type = :_type");
assertQuery("select te from TestEntity te where te.type = :type");
}
}