use of entityManager.createNativeQuery(query,foo.class)

后端 未结 5 658
-上瘾入骨i
-上瘾入骨i 2020-12-01 07:49

I would like to return a List of Integers from a

javax.persistence.EntityManager.createNativeQuery call

Why is the following incorrect?

5条回答
  •  [愿得一人]
    2020-12-01 08:17

    JPA was designed to provide an automatic mapping between Objects and a relational database. Since Integer is not a persistant entity, why do you need to use JPA ? A simple JDBC request will work fine.

提交回复
热议问题