How to get ResultSetMetaData from Entity Manager?

后端 未结 1 1409
無奈伤痛
無奈伤痛 2020-12-17 17:35

Is there a way to get the MetaData of the result returned by executing a nativeQuery on an Entity Manager in JPA?

1条回答
  •  时光说笑
    2020-12-17 17:55

    AFAIK there is no way of getting the result set metadata since there is no way really, of getting the result set. But, turn it around: what do you want the meta data for? Most of the information from the result set metadata you already have to have to be able to annotate your entity classes. The result set from conventional SQL/JDBC and the List you get from the EntityManager differs conceptually even if they can express the same semantics.

    0 讨论(0)
提交回复
热议问题