-
Notifications
You must be signed in to change notification settings - Fork 933
Collection filter on joined subclass #3079
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
Collection filter on joined subclass #3079
Conversation
After the Master-Merge the new Testcase fails now with the already mentioned error:
I don't know how to fix this one. I don't think it is related to my fix, cause the new test case also fails with this message without my changes. |
So, your fix is for 5.3? |
0e40fdb
to
8c3c86c
Compare
Yes, as I mentioned initially, the fix targets the 5.3 branch. The Master branch (i guess it's you current development branch) causes further issues at generating proper SQL in case of joins. |
The PR was pointing to the Another question @micmerchant. Did it work before? |
It's not a regression so it's not applicable for 5.3 branch. You should target master branch. And master SQL syntax problem needs to be investigated anyway. |
I believe I fixed issue with invalid SQL syntax on master in #3106. I also reproduced your issue using existing test data (see |
…_JoinedSubclass # Conflicts: # src/NHibernate.Test/Async/SubclassFilterTest/JoinedSubclassFilterTest.cs # src/NHibernate.Test/SubclassFilterTest/JoinedSubclassFilterTest.cs # src/NHibernate.Test/SubclassFilterTest/joined-subclass.hbm.xml
I finally found the time to merge the current Master (5.4) into this Branch. Yes, it seems that the SQL generation issues are fixed and at least my test cases are working. But my changes don't fix the alias resolution for your mapping changes (@bahusoid), what you also mention in one of the test cases. I'm not sure if got the time to take a look at it or if i have enough knowledge about the inner working of NHibernate to fix it. But, what I know is, if my fix doesn't fix all cases .. then it's not a real fix :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially thought that the filter name of a collection filter must match the entity filter name
Collection filters are separate from entity filters. The fact that your fix only works if the same entity filter exists makes your fix invalid.
src/NHibernate/Persister/Collection/AbstractCollectionPersister.cs
Outdated
Show resolved
Hide resolved
Legit. Now that I understand a little bit more, I'll rethink it and try to find an appropriate fix. |
…persister - entity persister only provides the column to table alias mapping anymore
Update: |
How to resolve "Changes requested" state? I guess, i was too fast with requesting another review, before i resolved the conversation :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a breaking change in current state - you shouldn't extend interfaces but only implementations (like add IFilterable
only to classes)
But anyway, I don't think we need FilterHelper
exposed everywhere. I spend some time on it and going to prepare a replacement PR with minimal API changes.
Fixed by #3264 instead. |
Hello,
there is an problem with the generation of SQL-Code when a collection filter is set on a joined subclass. Here is an example mapping (modified existing joined-subclass.hbm.xml).
Test case to display the issue:
The filter on the collection mapping of the Car entity targeting a joined subclass causes this issue. The property is defined in the base class of the inheritance relation.
But there is a difference in SQL generation between your Master (developing branch?) and your 5.3. (stable?) branch.
Master:
It seems there is a issue with join generation.
5.3:
There is an issue evaluating the proper table alias.
The fix targets the 5.3 branch and tries to forward the filter generation to the underlying entity persister:
Although it works, maybe there is a better way to evaluate the necessity to forward the generation call to the persister.
BR Michael