Hi,
I'm not sure hibernate can be of any assistance with this but worth asking...
Given is a table PLAN with two column (DATE PLANDATE, NUMBER VOLUME).
I'd like to calculate the average volume over a week and over a month.
"Pseudo-SQL:"
Code:
select sum(VOLUME)/count(*)
from PLAN
where PLANDATE> x and PLANDATE< y // x and y restrict to one week or one month
Now I'd like to have these two values inside the PLAN entity. So if I get a PLAN entity for a specific date I have two (transient i guess) methods like getWeekAverage and getMonthAverage...
A lot of questions in one here and night not all be doable with hibernate but any input would be appreciated!!
thanks!