This content has been marked as final.
Show 2 replies
-
1. Re: Is it possible to write a List object that comes from two tables?
serkan Mar 1, 2012 11:11 AM (in response to jinghuiyin)It is possible to use an entityquery which selects different columns from different tables.
The List you'll get is a List of Object[], or if you don't want Object[], you can specify your own holder object which holds the result, see below:
select new my.package.MyValueHolderObject(col1, col2, e.col3)
from Entity e
left join e.children1 col1
left join e.children2 col2
where e.property = :something
In this case the List will consist of MyValueHolderObjects.
-
2. Re: Is it possible to write a List object that comes from two tables?
jinghuiyin Mar 1, 2012 11:28 AM (in response to serkan)Thanks for your help, Serkan!