[hibernate-dev] Hibernate Disjunction Criteria broken: returns true for empty list of criteria
Adam Warski
adam at warski.org
Thu Oct 30 17:27:55 EDT 2008
Hello,
> When you form a Hibernate Disjunction criteria, but don't add any
> clauses to it, you get a criteria that matches everything.
>
> Generally, when you perform a reduction over an empty list, the
> expected result is the identity element for the reduction. For
> example, the sum of the empty list is 0, the product of the empty list
> is 1, the conjunction of the empty list is true, and the disjunction
> of the empty list is false.
You're right of course, Hibernate shouldn't stray away from ordinary
logic :) I would qualify it as a bug.
(that's only my opinion of course)
In fact, I have to fix this in Envers too, as after changing the
versions-query implementation not to use criteria, this will cause a
run-time exception - so thanks :).
--
Adam
More information about the hibernate-dev
mailing list