tags:

views:

25

answers:

0

In my database structure, I have tables T_DEPARTMENT and T_EQUIPMENT_STATS (stats having a many to one relationship with department via departmentid foreign key).

However, departments report their equipment monthly (available, in use, broken, etc).

In the Department class, I want a Map (actually a ConcurrentHashMap because of threading issues) to contain the Equipment Stats for the Department, but due to the need to access historical data, I have to be able to pass in a date (the Equipment Stats table has a date field).

AND, to make this even more fun, Departments are in a hierarchy, and there must be the option to either report only their own stats or a rollup of all their child organizations.

Can I map a "getEquipmentStats()" to the results of the named query?