Skip to content

BAEL-6377: CTE Support in Hibernate#19280

Open
sazzer wants to merge 2 commits into
eugenp:masterfrom
sazzer:BAEL-6377
Open

BAEL-6377: CTE Support in Hibernate#19280
sazzer wants to merge 2 commits into
eugenp:masterfrom
sazzer:BAEL-6377

Conversation

@sazzer

@sazzer sazzer commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

private Employee manager;

public Long getId() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the extra blank line (same elsewhere)

Comment on lines +41 to +51
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();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines +70 to +71
order by e.department, e.salary desc
""", Employee.class).getResultList();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting - fluent method calls should be split over multiple lines per dot according to the guidelines, as far as I remember


List<String> names = employees.stream().map(Employee::getName).toList();

assertEquals(List.of("David Kim", "Ella Novak", "Grace Lin", "Hugo Alvarez", "Ivy Chen", "Liam Foster"), names);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also use AssertJ assertThat(..).containsExactly(...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AssertJ isn't already part of this module, and it seems a shame to pull it in just for this case, though I can if you want.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok no worries leave as-is then

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class CteUnitTest {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we expand it to CommonTableExpressionsUnitTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants