Peter Holvenstot (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMDkwZmI1OTg1...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-14065?atlOrigin=eyJpIjoiMDkwZm...
) HHH-14065 (
https://hibernate.atlassian.net/browse/HHH-14065?atlOrigin=eyJpIjoiMDkwZm...
) Automatically break large collections into chunks (
https://hibernate.atlassian.net/browse/HHH-14065?atlOrigin=eyJpIjoiMDkwZm...
)
Change By: Peter Holvenstot (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Oracle has a limit of 1000 elements in an 'in' clause collection. If you need to
check more than 1000 elements you need to break it into two clauses.
For example: "select from Person where firstName IN (:largeCollection : )"
can be transformed into: "select from Person where (firstName IN :largeCollection1 or
firstName IN :largeCollection2 or firstName IN : largeCollection3 ...)"
Can the task of breaking the collection into sub-collections of 1000 and modifying the
string be added to the Oracle dialect automatically if a collection of above 1000 elements
is used as a parameter?
Hibernate is a bit of a “leaky abstraction” here in the sense that perfectly intuitive
Java behavior (“why can’t I have more than 1000 elements in a collection?”) leaks SQL
requirements into the application layer, and it’s pretty ugly to have to fix it every
single place there is a “in” clause in a query.
(
https://hibernate.atlassian.net/browse/HHH-14065#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14065#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100128- sha1:0213fc8 )