HQL: Using the IN together with an array of orm entitites

67 views
Skip to first unread message

Marco Betschart

unread,
Aug 3, 2012, 4:27:53 PM8/3/12
to ra...@googlegroups.com
I've got the following code which works on ACF 9.0.1:

SELECT b FROM branch AS b
WHERE b.company IN (:companies)

Where :companies holds an array of company entities which were loaded before. In Railo 3.3.4.003 final I receive the following error: "Can't cast Object type [java.util.ArrayList] to a value of type [Component]".

Is this possible at all in Railo? If not, how may I select entities which contain a given set of entities which have to be in a relation with the searched object??

Jeroen Knoef

unread,
Aug 4, 2012, 7:37:20 AM8/4/12
to ra...@googlegroups.com
I got the same error, so I would say that this is a bug. It's probably a good idea to create an issue for it in JIRA.

There was a similar issue, which is resolved: https://issues.jboss.org/browse/RAILO-1859, but that issue concerns simple values.

You can use an array of id's instead as a workaround until it is fixed:

FROM branch AS b
WHERE b.company.id IN (:companyIds)

I'm assuming here that the company entity has an id property named id.

Marco Betschart

unread,
Aug 4, 2012, 8:04:00 PM8/4/12
to ra...@googlegroups.com
That's what I've done already to take the development further. Where may I open this issue exactly?

Jeroen Knoef

unread,
Aug 6, 2012, 3:25:03 AM8/6/12
to ra...@googlegroups.com
https://issues.jboss.org/browse/RAILO

This link is provided in the Railo administrator as well, at the bottom of the overview page.
Reply all
Reply to author
Forward
0 new messages