Hibernate version: 3.2 cr2
Name and version of the database you are using: HSQL 1.8.0
Hi,
Lets say there is an 'EmployeeTravelAllowance' entity that defines the travel allowance for employees based on attributes like 'department', 'businessUnit', 'category' ( with values like permanent and contract ).
Now, when the allowances are defined, one starts with a default for the general employee population and specific values for specific sections of the population.
For e.g,
{businessUnit='ALL', department='ALL', category='ALL', allowance=80}
{businessUnit='Unit-A', department='ALL', category='ALL', allowance=90}
{businessUnit='Unit-A', department='ALL', category='Permanent', allowance=100}
This means that,
- for 'Permanent' employees of 'Unit-A', the allowance is 100
- for other employees of 'Unit-A', the allowance is 90
- for all other employees the allowance is 80
Now, given an employee bean with values defined for each attribute, I'd like to retrieve the allowance thats most relevant. In this case, the order in which the property conditions should be relaxed to find the next closest match is {category,department,businessUnit}. This order of relevance is an input.
I'd like to know if there is any utility in Hibernate or on top of it that solves this problem ?
Thanks,
Radhakrishnan
|