Hi,
I have a mapping question.
Suppose I have a master class "Payroll" which has more than one associations with another
Code:
class "PayrollSection". Each have their role names:
class Payroll {
long id;
List<PayrollSection> shiftSections;
List<PayrollSection> paymentSections;
List<PayrollSection> deductionSections;
PayrollSection legalDeduction;
...
}
Here I have 3 unidirectional one-to-manys and 1 one-to-one. I could not figure out how to tell hibernate about their role names so hibernate can distinguish them when generating SQLs.
One solution seems like adding a property to PayrollSection as a discriminator and using a filter clause within <one-to-many> but that I could not get it to work. If that is the way to go I may elaborate my question in that direction.
Other solution seemed like adding the discriminator again and using the "where" clause with <one-to-many>. But in that case the where clause consists of what i included there and i do not know how to make it add the key equality ANDed to my discriminator clause. like
Code:
paymentsec0_.payroll=?
I may elaborate on that too if that is the direction.
I would like to know how you guys handle such a mapping requirement.