Skip to content

Commit

Permalink
Fix query parsing error for properties using reserved lateral keyword.
Browse files Browse the repository at this point in the history
Add tests for existing parsers and fix the HQL one.

Closes #3496
Original pull request #3497
  • Loading branch information
christophstrobl authored and schauder committed Jun 12, 2024
1 parent 2656308 commit 724555a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ reservedWord
| JOIN
| KEY
| LAST
| LATERAL
| LEADING
| LEFT
| LIKE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1024,4 +1024,11 @@ void entityNameWithPackageContainingReservedWord(String reservedWord) {
String source = "select new com.company.%s.thing.stuff.ClassName(e.id) from Experience e".formatted(reservedWord);
assertQuery(source);
}

@Test // GH-3496
void lateralShouldBeAValidParameter() {

assertQuery("select e from Employee e where e.lateral = :_lateral");
assertQuery("select te from TestEntity te where te.lateral = :lateral");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1566,6 +1566,13 @@ void typeShouldBeAValidParameter() {
assertQuery("select te from TestEntity te where te.type = :type");
}

@Test // GH-3496
void lateralShouldBeAValidParameter() {

assertQuery("select e from Employee e where e.lateral = :_lateral");
assertQuery("select te from TestEntity te where te.lateral = :lateral");
}

@Test // GH-3099
void functionNamesShouldSupportSchemaScoping() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,13 @@ void typeShouldBeAValidParameter() {
assertQuery("select te from TestEntity te where te.type = :type");
}

@Test // GH-3496
void lateralShouldBeAValidParameter() {

assertQuery("select e from Employee e where e.lateral = :_lateral");
assertQuery("select te from TestEntity te where te.lateral = :lateral");
}

@Test // GH-3061
void alternateNotEqualsOperatorShouldWork() {
assertQuery("select e from Employee e where e.firstName != :name");
Expand Down

0 comments on commit 724555a

Please sign in to comment.