Can I get column names in my own JPA SQL query?

Possible duplicate:
How to get ResultSetMetaData from enity manager?

Given a simple table ( example_table ) with the following columns: id, first_name, last_name it possible, by executing your own JPA sql server em.createNativeQuery("select * from example_table") , to get column names and also data? Running getResultList() in the query returns data. How else can I get the column names?

+6
source share
1 answer

try it

em.unwrap (Session.class) .getDescriptor (Currency.class) .getFields ()

0
source

Source: https://habr.com/ru/post/885919/