When trying to access results from an ORM object via a member function, ex: array.each(), I get this: No matching Method/Function for org.hibernate.collection.PersistentBag.each(lucee.runtime.type.Closure) found.
Consider this general example where a persistent user object can have many roles.
This relationship will in turn create the function getRoles() in the user object which will return an array of role objects that I want to access.
The below code is what errors...
Note that this runs in ACF 11.
Windows 8.1 / nginx / Tomcat 8.0.23 / Lucee 4.5.1.022 (WAR)
I figured this behavior too, and was about to open a new ticket. If it can help, I attach a full test case (case1.zip) I worked on to understand the issue...
NB: the problem occurs only after the EntitySave() call.
This is happening with arrays from Postgres Array fields as well.
Type: Native Array (java.lang.String)
No matching Method/Function for [[Ljava.lang.String;.each(lucee.runtime.type.Closure) found]]
As Brad mentioned, it has to be changed to ArrayImpl before using the array with member functions
This is reproducible anywhere you return array of entities.
Lucee 5 support to loop any List objects like this out of the bag, because "PersistentBag" is a list object this works now just fine.
this is already fixed