[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1123?page=c...
]
Steve Ebersole commented on HHH-1123:
-------------------------------------
Haavar, but see that problem is tailor made to explain why SQL added temporary tables.
Siddarth, again you are thinking of the simplistic case. But a solution in a library has
to account for all cases. Not to mention that you gloss over exactly what it is you think
the library should actually do. So your example receives 9999 element collection, it
passes your built in <10000 check, but will still obviously fail on these databases we
are talking about. So what do you think Hibernate should do? And not that I already
explained why a "simple split" will not work.
Cannot put more than 1000 elements in a InExpression
----------------------------------------------------
Key: HHH-1123
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1123
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 3.1 rc2, 3.2.0.alpha1
Environment: Oracle 9i
Reporter: Alexis Seigneurin
Assignee: Strong Liu
Attachments: Animal.hbm.xml, hibernate-inexpression-oracle-3.2.patch,
HQLHelper.java, LongInElementsTest.java, patch.txt
Original Estimate: 1h
Remaining Estimate: 1h
The number of elements that we can put in a "in" expression is limited to a
certain amount (1000 for Oracle, for instance). When creating a criteria query, the
org.hibernate.criterion.InExpression class should split the expression into several
smaller ones.
Attached is a patch which splits the expression by slices of 500 elements. For example,
if we have 1001 elements to put in the "in" expression, the result would be :
(entity.field in (?, ?, ?...) or entity.field in (?, ?, ?...) or entity.field in (?))
The surrounding parantheses are useful to avoid problems with other conditions (a
"and" condition taking over the one of the "or" conditions).
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira