0

actually I want to direct take as Bean from NativeQuery

suppose we have one table Employee in that have firstName,lastName, email, age,salary, So i want Specific column like firstName,lastName,email with native query , but I don't want take Object[] for specific field,

it possible to convert direct bean without using Object[]

I don't want examle:- List<Object[]> = em.createNativeQuery(" select first_name, last_name, email from employee").getResultList();

if you have better idea to get as beans so please share with us

Thanks

Jacob
  • 168
  • 2
  • 13
jack
  • 1
  • 3
  • 1
    Possible duplicate of [Spring Data JPA map the native query result to Non-Entity POJO](https://stackoverflow.com/questions/29082749/spring-data-jpa-map-the-native-query-result-to-non-entity-pojo) – Adil Khalil May 02 '18 at 11:51
  • Possible duplicate of [Spring data jpa - the best way to return object?](https://stackoverflow.com/questions/46878292/spring-data-jpa-the-best-way-to-return-object) – Cepr0 May 02 '18 at 12:09

0 Answers0