I have two tables in DB and two entities. HtmlDesc and HtmlData.
Both with the same id. Is there a way to create compund/merged entity in Hibernate without repeating code from this two entities. I want to execute statment
Query<Html> query = getCurrentSession().createNativeQuery(
"SELECT * FROM HtmlDesc A, HtmlData B WHERE A.linkId = B.linkId",
Html.class);
return query.getResultList();
to map to new entity Html = HtmlDesc+HtmlData. Is there some smart code to write such entity?
Afterwards i found related topic which can be helpful if someone have similar problem: JPA- Joining two tables in non-entity class