How we can load transient fields in JPA from select queries.
For example I have this query:
SELECT table1.*, (SELECT SUM(field) from table2 WHERE theField=table1.flag) as total FROM table1;
So here I need a transient field called "total" in my bean.
But it seems it is not possible in JPA
You can make use of a
constructor
inJPQL
Query:
Entity: