|
I work with sales and I need to store the average sales of a product, for example, the average of sales per day of week.
How could I map the following table:
create table average_perweek (
product_code int,
average_total int[7],
average_count int[7])
The average_total would be the average value and average count would be how many times did I calculate it. (kind of pre calculated average).
The problem I'm having is with the primitive array columns. (int[]). How do I map it??
Create another table for that?? Hummm I don't think would be a good Idea, manly cause later I want to do the same thing, but with months, like:
create table average_permonth (
product_code int,
average_total int[12][31],
average_count int[12][31])
Is the table above possible to be mapped in the hibernate?? Any suggestion??
To create another table would make it very slow as the other table would get really huge due the amount of products I have.
Please, any suggestion?
Best regards,
|