Hello there.
In java application I use hibernate criteria queries, for example:
Criteria criteria = session.createCriteria(Any.class);
...
List<?> list = criteria.list();
and I definetly know that result list contains only objects of type Any but I don't know if it's possible to get list of type defined above?
In this case, if I want to use foreach it's necessary to convert type from object to type Any
for(Object object : list) {
...
((Any)object).
...
}
Or if I need to get an array I have to do something like this:
list.toArray(new Any[]{});
Do you have any ideas?