JPA Entities - Mapping multiple columns to a collection - too many columns
843830Sep 9 2009 — edited Sep 10 2009Hi All,
I am using a table which has 30 minute window for each hour on a Day. [24*2 = 48 columns for a particular attribute for a day]. And similarly i have to maintain 5 attributes (so 5*48 = 240 columns)
Table structure - [ Id | attr1_01 | attr1_02 | ..| attr1_48 | attr2_01 | attr2_02 | ..| attr2_48 | attr3_01.....attr3_48 .....]
These columns are simple and at the maximum, they have a single digit number for each slot.
Leaving apart the question of normalization, How can I create a JPA entity for this table effectively? Is there a way to map this to arrays? like attr1[0] to attr1[47] ? Or any other collection?
Thanks for your help !!!