Hibernate Native SQL Query retrieving entities and collections

前端 未结 5 1613
谎友^
谎友^ 2020-12-13 06:54

This is my situation, I have two basic POJO\'s which I\'ve given a simple hibernate mapping :

Person
  - PersonId
  - Name
  - Books

Book
  - Code
  - Descr         


        
5条回答
  •  既然无缘
    2020-12-13 07:46

    AFAIK, it is not possible to get a "merged" entity back from a SQL query. You will get back only an object array. What I did in this situation was that I created a new constructor for my merged entity that took an array of objects as it's argument. Then I constructed that manually.

提交回复
热议问题