Skip to content

Table group joins support in hql #2361

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

Merged
merged 2 commits into from
Sep 14, 2020
Merged

Conversation

bahusoid
Copy link
Member

@bahusoid bahusoid commented Apr 23, 2020

Loose port of hibernate/hibernate-orm@753858c

Example of SQL generated with "group joins":

SELECT *
FROM Person person0_
INNER JOIN (
	IndividualCustomer individual1_ 
	INNER JOIN Customer individual1_1_ ON individual1_.IndividualCustomerID = individual1_1_.Id
	) ON person0_.Id = individual1_.PersonID AND individual1_1_.Deleted = @p0

It's useful when withClause needs to be applied to multiple tables:

  • subclasses with withClause referencing base tables
  • Complex withClause with implied joins (like from a in A join b in B b on a.Id equals b.C.D.Id also see added test case WithImpliedJoinOnAssociation)
  • Many-to-many with filters/ withClause (makes fix implemented in Fix #1994 (many-to-many filter in hql) #1995 obsolete as with group joins no null data is retrieved)

Fixes hql/Linq for #1209 and #1215

@bahusoid bahusoid force-pushed the WIP_groupJoin branch 3 times, most recently from 50defd3 to f900af8 Compare September 11, 2020 07:51
@bahusoid bahusoid changed the title WIP Table group joins support for subclasses with withClause in hql Table group joins support in hql Sep 11, 2020
@bahusoid
Copy link
Member Author

It's done! It's a good stuff :)

@fredericDelaporte

This comment has been minimized.

@bahusoid

This comment has been minimized.

@fredericDelaporte

This comment has been minimized.

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

Successfully merging this pull request may close these issues.

4 participants