Skip to content

Commit

Permalink
TYPE should be a valid attribute of an entity for a custom query.
Browse files Browse the repository at this point in the history
See #3062, #3056.
  • Loading branch information
gregturn committed Jul 10, 2023
1 parent f7d1c88 commit d232038
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ identification_variable
| OUTER
| FLOOR
| SIGN
| TYPE
| VALUE)
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1549,4 +1549,11 @@ void binaryLiteralsShouldWork() {
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");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -941,4 +941,11 @@ void queryWithSignShouldWork() {
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");
}
}

0 comments on commit d232038

Please sign in to comment.