Skip to content

NH-2049 - Error with filters on joined-subclass as one-to-one #1209

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
nhibernate-bot opened this issue Oct 12, 2017 · 1 comment · Fixed by #2545
Closed

NH-2049 - Error with filters on joined-subclass as one-to-one #1209

nhibernate-bot opened this issue Oct 12, 2017 · 1 comment · Fixed by #2545

Comments

@nhibernate-bot
Copy link
Collaborator

nhibernate-bot commented Oct 12, 2017

Ville Häkli created an issue — 22nd December 2009, 1:18:51:

We have following entities:

  • Customer, which has deleted property
  • IndividualCustomer, which is inherited from Customer and has one-to-one (mapped as many-to-one with unique=true) relation to Person
  • Person which has IndividualCustomer property as one-to-one with property-ref to IndividualCustomer's Person property

If we enable filter, which filters deleted customers by deleted property and get person with criteria, following SQL is generated:

SELECT ...
FROM   Person this_
left outer join IndividualCustomer individual2_ on this_.Id = individual2_.PersonID and individual2_1_.Deleted = 1
left outer join Customer individual2_1_ on individual2_.IndividualCustomerID = individual2_1_.Id

This obviously fails because the "filtering condition" (individual21.Deleted = 1) is in wrong join.


cur3n4 added a comment — 5th April 2011, 17:19:04:

Still happening in Hibernate 3.1.0.4000


M. Uld added a comment — 28th July 2011, 12:08:36:

Still happen in Hibernate 3.2.0.3001. Attaching a NHibernate 3.2 test fixture with a simplier exemple to reproduce.


Brian J. Sayatovic added a comment — 10th November 2011, 21:47:03:

Does anyone have a patch for this? I'd be willing to try it. This bug is stopping us from inserting data.


[email protected] added a comment — 15th February 2013, 23:42:24:

Still happens in NHibernate 4 master.


Oskar Berggren added a comment — 27th July 2014, 12:36:06:

Note that NH2049.zip uses a criteria query, while NH2049-NHib-3.2RC1.zip uses HQL. Both fail. Combined and slightly reworked test cases, still failing, added to 3.4.x branch in 7240908.

@untilted-document
Copy link

Still happens on 5.3

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

Successfully merging a pull request may close this issue.

3 participants