[coldbox-3.5.0] criteria builder + IN method

this throws an error:

criteria.isIn(“IDCol”,javaCast(“java.lang.Integer[]”,listToArray(valueList(queryResult.IDCol)))).list();

An unhandled exception has occurred. Please look at the diagnostic information below:
Type org.hibernate.exception.GenericJDBCException
Message could not execute query
Detail

Extended Info

Message could not execute query
Tag Context C:\inetpub\Frameworks\coldbox\coldbox_3_5\system\orm\hibernate\CriteriaBuilder.cfc (161)

the valuelist() dumps as “1321818,1534258,1433553”.

this does NOT throw an error:

criteria.isIn(“IDCol”,javaCast(“java.lang.Integer[]”,listToArray(“1321818,1534258,1433553”))).list();

the same results show when using restrictions in a criteria query.

For the is in just pass a list not an array try that

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano

test = “1321818,1534258,1433553,1450521,1268483,1290213,1447733,1177606”;

listCriteria.isIn(“IDCol”,test).list();

throws:

An unhandled exception has occurred. Please look at the diagnostic information below:
Type java.lang.ClassCastException
Message

Detail

Extended Info

Message

Tag Context

Stack Trace java.lang.ClassCastException

Hmm I will have to look at some of my examples.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano