Hi,
I have the following model:
- a class Currency
- a class Date
- a class FXRate
There are about 50 Currency instances.
Each Currency object holds a large map, whose key is Date and value is FXRate.
When I access a fx rate I call currency.getFXRate(date)
At this point, I want to be able to control the prefetching strategy.
Strategy 1:
- All the fx rates for the same date are prefeteched and loaded in cache
Strategy 2:
- All the history for the last ~2 years for the given currency is prefetched in cache.
I want to be able to choose at runtime whether to use Strategy 1 or 2.
How to achieve this with Hibernate (2 or 3) ? Please give some examples.
This is a critical question for choosing Hibernate.
Thank you.
|