Hibernate version:
Current latest
Assume the following
table schema
(col1, col2, col3), where we can assume the primary key as a composite key of all three columns.
Sample rows/values:
(MMSA_001, STX1, 105),
(MMSA_002, STX1, 105),
(MMSA_003, STX1, 105),
(MMSA_004, STX1, 105),
(CCSA, STXB, 33),
(IRA_SH_ESA_SA, STX1, 101),
(IRA_SH_ESA_SA, STX1, 102),
(CT_1K_MIN_001, STXB, 1),
(CT_1K_MIN_001, STXB, 11),
(CT_1K_MIN_001, STXB, 24)
So on...
The class we have is:
Code:
class Sample {
String productId;
HashMap screenPointerMap;
}
According to the last 3 rows (that are colored
red), after mapping, we would like to have an instance of the above class Sample, with the following values.
CT_1K_MIN_001 for the
productId property
and the
screenPointerMap property will contain one element that will hold the key as STXB and the value of the map will be a list storing the integers 1, 11, 24.
Basically, based on the column relationships, mapping 3 rows to one instance of one class.
Is this possible as it is with the existing table schema...?
Any alternative suggestions also will be greatly helpful.
Thanks all.