Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Query on formula m2o-property uses wrong alias: #3145

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

rPraml
Copy link
Contributor

@rPraml rPraml commented Aug 8, 2023

The following queries produce the wrong SQL:

    DB.find(TreeNode.class).select("id")
      .where().isNotNull("children.ref.id")
      .findList();

Actual

select distinct t0.id 
from tree_node t0 
join tree_node u1 on u1.parent_id = t0.id 
join e_basic u2 on u2.id = u1_ref.id -- unknown alias here
where u2.id is not null

Expected

select distinct t0.id
from tree_node t0
join tree_node u1 on u1.parent_id = t0.id
join e_basic u1_ref on u1_ref.id = u1.soft_ref -- this path is missing in the query above
join e_basic u2 on u2.id = u1_ref.id
where u2.id is not null

rPraml added a commit to FOCONIS/ebean that referenced this pull request Aug 10, 2023
@rob-bygrave rob-bygrave added this to the 13.20.2 milestone Aug 11, 2023
@rbygrave rbygrave merged commit 9097466 into ebean-orm:master Aug 14, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants