BAEL-6377: CTE Support in Hibernate - #19280
Conversation
| private Employee manager; | ||
|
|
||
| public Long getId() { | ||
|
|
There was a problem hiding this comment.
Remove the extra blank line (same elsewhere)
| with engineers as ( | ||
| select e.id as id | ||
| from Employee e | ||
| where e.department = 'Engineering' | ||
| ) | ||
| select e | ||
| from Employee e | ||
| where e.id in (select id from engineers) | ||
| and e.salary > 100000 | ||
| order by e.name asc | ||
| """, Employee.class).getResultList(); |
There was a problem hiding this comment.
What are your thoughts on using uppercase WITH AS SELECT FROM etc, was it intentional to use lowercase here? The init.sql file does uses the uppercase convention
| order by e.department, e.salary desc | ||
| """, Employee.class).getResultList(); |
There was a problem hiding this comment.
Formatting is a bit different here than in the test below - let's pick a common approach for how to format these """ blocks
| order by e.department, e.name | ||
| """, Employee.class).getResultList(); | ||
|
|
||
| List<String> names = employees.stream().map(Employee::getName).toList(); |
There was a problem hiding this comment.
Formatting - fluent method calls should be split over multiple lines per dot according to the guidelines, as far as I remember
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class CteUnitTest { |
There was a problem hiding this comment.
How about we expand it to CommonTableExpressionsUnitTest
| ORDER BY e.department, e.name | ||
| """, Employee.class).getResultList(); |
There was a problem hiding this comment.
One of these leftover not matching the """ format of the other tests
No description provided.