Skip to content

[#1501] Fix SubselectFetchTest #1729

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

Closed
wants to merge 2 commits into from

Conversation

blafond
Copy link
Member

@blafond blafond commented Aug 14, 2023

fixes #1502

@blafond blafond force-pushed the 1501-subselect-fetch-test branch from 3b3252a to 4ba8cf8 Compare August 17, 2023 19:26
@blafond
Copy link
Member Author

blafond commented Aug 17, 2023

ReactiveEntityResultInitializer was extending ReactiveAbstractEntityInitializer but ReactiveAbstractEntityInitializer was not extending EntityResultInitializer (was extending AbstractEntityInitiailzer)

Replaced the extended class of ReactiveAbstractEntityInitializer with EntityResultInitializer so the proper methods were called during the loading of associated collection

@blafond
Copy link
Member Author

blafond commented Aug 17, 2023

Note that this change/fix did not fix #1501. BatchFetchTest testQuery() and testBatchLoad() are failing

Copy link
Member

@DavideD DavideD left a comment

Choose a reason for hiding this comment

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

I don't understand why this fixes the issue, and I don't think it's correct even if it does.
That's said, I think you are on the right track.

The reason I don't think this is correct is that now ReactiveEntityJoinedFetchInitializer becomes a subclass of EntityResultInitializer. This is different from what's happening in ORM where EntityResultInitializer and EntityJoinedFetchInitializer are both subclasses of AbstractEntityInitializer. That's why in Hibernate Reactive we have ReactiveAbstractEntityInitializer mimicking AbstractEntityInitializer

Also, I don't understand why this change makes the test pass.
The only difference between ReactiveEntityResultInitializer and EntityResultInitializer is the CONCRETE_NAME. Maybe that's what's causing the test to fail?

@blafond
Copy link
Member Author

blafond commented Aug 21, 2023

ORM's 6.2 version of SubselectFetch contains a check on EntityResultInitializer which explains why my fix works.

In ORM 6.3, they've cleaned up SubselectFetch and that check is gone.

So I can merge my commit if we need to release another HR version off of 6.2, or push this issue to our 6.3 version?

@DavideD
Copy link
Member

DavideD commented Aug 21, 2023

We cannot merge this commit.

We could avoid extending ReactiveAbstractEntityInitializer and convert it to a delegator similar to what we do in ReactiveSingleTableEntityPersister

@blafond
Copy link
Member Author

blafond commented Aug 21, 2023

k... I'll check that out. thx

@DavideD
Copy link
Member

DavideD commented Aug 31, 2023

Note that this issue was solved by a change in Hibernate ORM.
From this PR we only need the commit that re-enable the test after the next Hibernate ORM upgrade.

@DavideD
Copy link
Member

DavideD commented Sep 1, 2023

@blafond I've just tested this with 6.3 and it doesn't seem to work. Could you double check?
I've updated the 2.1 branch to include 6.3.0.Final already

@blafond
Copy link
Member Author

blafond commented Sep 1, 2023

sure

@DavideD
Copy link
Member

DavideD commented Sep 1, 2023

Superseded by #1746

@DavideD DavideD closed this Sep 1, 2023
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.

SubSelectFetchTest fails
3 participants