Question

I have a serious problem: the ParameterList variable in my HQL has 10k+ elements, so Hibernate can't work with it (stackoverflow), now i'm trying to convert it into DetachedCriteria query, but it's look like this:

final StringBuffer hql = new StringBuffer(
        "SELECT new db.XXXTable(c.abc1, c.abc2, c.abc3, a.def1, a.def2, a.def3, a.def4, a.def5, a.def6, a.def7, a.def8) FROM def AS a, abc AS c WHERE a.def7 IN (:ids) AND a.def7 =c.abc1 AND a.def9 = TRUE ");

session = getSession();
final Query query = session.createQuery(hql.toString());

query.setParameterList("ids", importIdList);
result = query.list();

db.XXXTable has his own constructor.

I saw that maybe the DetachedCriteria query can handle this, but i can't figure it out, how to use it on this (from two tables into a unique class selection...)

But if someone know how to solve the stackoverflow error, it would be also helpfull!

Thank you very much!

Was it helpful?

Solution

Had to upgrade to 3.6.9. This version seems to handle 10k+ elements in the parameterList.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top