开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜