I'm executing stored procedure with Hibernate native method, this stored procedure creates column names depending on another table Ids. So its columns look like something like this:
| id | ... some other columns ... | name | c_1 | c_2 | c_4 | c_.. |
If I call Query.getResultList()
it returns List<Object[]>
, and I don't know column names. I have to know column names (and corresponding column index) to continue my further business logic. I also cannot use EntityManager.createNativeQuery(String s, Class aClass)
since it is not one POJO class.
Currently I'm getting List<Object[]>
without problem, but I need, for example, Map<String,Object[]>
column name as a key and column values as an array of Objects.
How can I get all column names with their values?