Hi,
I am struggling to use JpaContainer getting results from two joined tables for a Vaadin table as follows.
I have two tables (just examples, not real tables.)
table 1
+------+--------+
| id | itemid |
+------+--------+
| 001 | id01 |
| 002 | id01 |
| 003 | id02 |
| 004 | id03 |
+------+--------+
table 2
+--------+----------------------+------------+
| itemid | description | date |
+--------+----------------------+------------+
| id01 | description for id 1 | 2014-12-02 |
| id02 | description for id 2 | 2013-01-02 |
| id03 | description for id 3 | 2013-01-02 |
+--------+----------------------+------------+
and I need a vaadin table from the join statement as follows
select table1.*, table2.* from table1 left join table2 on table1.itemid = table2.itemid;
+------+--------+--------+----------------------+------------+
| id | itemid | itemid | description | date |
+------+--------+--------+----------------------+------------+
| 001 | id01 | id01 | description for id 1 | 2014-12-02 |
| 002 | id01 | id01 | description for id 1 | 2014-12-02 |
| 003 | id02 | id02 | description for id 2 | 2013-01-02 |
| 004 | id03 | id03 | description for id 3 | 2013-01-02 |
+------+--------+--------+----------------------+------------+
I have tried to use embedabble and onetomany settings but no luck.
How would I achieve this using JpaContainer so that I take advantage of lazy loading to speed up the table loading, because the description field in the real table it has very long text per row, i.e. 2mb of text for some fields, so loading a big list makes the application to hang.
If someone would be kind to illustrate this by example, i would greatly appreciate the help.
NB: notice the double itemid field in the resulting table, how to get only one itemid field returned.?
Regards.