On Fri, Oct 3, 2014 at 3:24 PM, Tom Evans <tevans...@googlemail.com> wrote: > On Fri, Oct 3, 2014 at 3:13 PM, Tom Evans <tevans...@googlemail.com> wrote: >> I tried converting the selected data to SIGNED INTEGER, eg >> "CONVERT(country_id, SIGNED INTEGER) AS country_id", but this did not >> have the desired effect. > > However, changing them to be cast to CHAR changed the error message - > "java.lang.Integer cannot be cast to java.lang.String". > > I guess this is saying that the type of the map key must match the > type of the key coming from the parent entity (which is logical), so I > guess my question is - what do SQL type do I need to select out to get > a java.lang.Integer, to match what the map is expecting? >
I rewrote the query for the map, which was doing strange casts itself (integer to integer casts). This then meant that the values from the parent query were the same type as those in the map query, and no funky casts are required anywhere. However, I still don't have a way to determine which field is failing when indexing fails like this, and it would be neat if I could determine a way to do so for future debugging. Cheers Tom