Possible Duplicate:
How to get ResultSetMetaData from enity manager?
Given a simple table (example_table
) with the following columns: id, first_name, last_name
is it possible, by executing a JPA native sql query em.createNativeQuery("select * from example_table")
retrieve the column names as well as the data? Running the getResultList()
on the query only returns the data. How else can I retrieve the column names?
try this
em.unwrap(Session.class).getDescriptor(Currency.class).getFields()