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

Softdelete on @OneToMany is ignored after refresh() (since 12.11.5) #2581

Closed
RualSepp opened this issue Mar 3, 2022 · 1 comment
Closed
Assignees
Milestone

Comments

@RualSepp
Copy link

RualSepp commented Mar 3, 2022

Behavior regression introduced in 12.11.5 via #2376


Expected behavior

Loading the @onetomany list after refresh() should result in the same SQL-Query as before.

Actual behavior

After refresh() the deleted field is ignored.

Steps to reproduce

User user = DB.find(User.class,1);
//Before refresh()
user.getGroups().forEach(ug->System.out.println(ug.toString()));
user.refresh();
//After refresh()
user.getGroups().forEach(ug->System.out.println(ug.toString()));
--before refresh()
     select
        t0.User_id,
        t0.id,
        t0.deleted,
        t0.User_id,
        t0.Group_id,
    from
        User_Group t0 
    where
        (
            t0.User_id
        ) in (
            ?
        ) 
        and t0.deleted = 0; 
----------------------------------------------------------------------------------------------------
--after refresh()
     select
        t0.User_id,
        t0.id,
        t0.deleted,
        t0.User_id,
        t0.Group_id,
    from
        User_Group t0 
    where
        (
            t0.User_id
        ) in (
            ?
        ) ; 
@rbygrave
Copy link
Member

rbygrave commented Mar 10, 2022

Reference: #2376 ... as the issue that introduced this change in behaviour (and the change we need to adjust in order to fix this issue).

@rbygrave rbygrave self-assigned this Mar 10, 2022
@rbygrave rbygrave added the bug label Mar 10, 2022
@rbygrave rbygrave added this to the 12.16.0 milestone Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants