title: Getting dynamically generated column names from result of Hibernate native query
body: <p>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:</p>
  
  <blockquote>
    <p>| id | ... some other columns ... | name | c_1 | c_2 | c_4 | c_.. |</p>
  </blockquote>
  
  <p>If I call <code>Query.getResultList()</code>  it returns <code>List&lt;Object[]&gt;</code>, 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 <code>EntityManager.createNativeQuery(String s, Class aClass)</code> since it is not one POJO class. </p>
  
  <p>Currently I'm getting <code>List&lt;Object[]&gt;</code> without problem, but I need, for example, <code>Map&lt;String,Object[]&gt;</code>  column name as a key and column values as an array of Objects.</p>
  
  <p>How can I get all column names with their values?</p>