I have 2 tables TABLE1 and TABLE2. hibernate class of TABLE1
class Table1 {
private Collection< table2s> table2s= new ArrayList< table2s>();
}
Now using criteria I need to fetch Table1 records and the results should have Table2s one records among list which is linked to Table1.
eg: TABLE 1 TABLE1ID NAME 1 A 2 B TABLE 2 TABLE2ID TABLE1ID TABLE2NAME 1 1 XXXXX 2 1 XXXXXX 3 1 XXX 4 2 YYYY 5 2 YYYYYY
Expected Output: TABLE1ID NAME TABLE2ID TABLE2NAME 1 A 1 XXXXX 2 B 4 YYYY
something like table1.gettable2s().get(0)