I have two tables that share a common key. What I'd like is that when I load the class for the first table, I would also get a list of classes corresponding to the second table where they share the key.
More specifically: tableA has an id (id1) that exists in multiple entries of tableB. However, tableB uses a composite key and uses both id1 and id2 as keys.
What I'd like to achieve is that when the POJO for tableA is loaded, i also get all entries of table B where id1 from table A equals id1 in table B. Something like:
public class TableA {
private String id1;
private List<TableB> list; // where id1 in tableA == id1 in tableB
}
table A id column:
id1
table B composite id:
id1 // same as for tableA
id2