How to get metadata column from native query

Is there any way to get metadata columns of a query result from Native Query ?

Query query = entityManager.createNativeQuery(queryString);
List resultList = query.getResultList();

I need it when I want to export a ResultSet of a table into csv …

I managed to do it by getting the connection first then creating a function which converts ResultSet into Set. To prevent the order, you must use LinkedHashMap.

Meanwhile, this is a solution, waiting for your answers.

Hi Gent,

Please, find an example here. Particularly you will be interested in this part.



1 Like

Hi Aleksey,

Thanks, that will help me avoiding extra code with Object mapping.

Best Regards,