-->
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.  [ 1 post ] 
Author Message
 Post subject: Searching the most relevant entity using given an Example
PostPosted: Mon Aug 21, 2006 9:22 am 
Newbie

Joined: Sat Aug 12, 2006 1:20 am
Posts: 7
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


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

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.