These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Native array columns (multiple dimensions). How to map?
PostPosted: Tue Oct 02, 2007 7:31 pm 
Newbie

Joined: Tue Oct 02, 2007 7:17 pm
Posts: 1
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,


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 2:43 am 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
Maybe you can use something similar to this:

http://www.hibernate.org/50.html

Regards,
Pavol


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.