开发者

Can I retrieve column names in a JPA native sql query? [duplicate]

开发者 https://www.devze.com 2023-02-26 04:34 出处:网络
This question already has an answer here: Closed 10 years ago. Possible Duplicate: How to get ResultSetMetaData from enity manager?
This question already has an answer here: Closed 10 years ago.

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()

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号