Hibernate - createNativeQuery with “non-entity class” result

前端 未结 6 1915
清酒与你
清酒与你 2021-01-04 20:13

I\'m new to all this Hibernate/JPA stuff, so i will try to be as clear as possible.

Is there any way in Hibernate to use createNativeQuery to select a single/or mult

6条回答
  •  梦谈多话
    2021-01-04 20:45

    In case of Native query or jpql with column name EntityManager Returns a List of array of objects.

    so to get Result List.

    receive it in a

     List listResults = query.getResultList();
    

    then iterate over it:-

    for (Object[] record : listResults) {
    
                //Iterate Logic will come here
    
                        }
    

提交回复
热议问题