Hello there ! I am new to HQL and got to a roadblock with my application. I hope someone can provide a little guidance ;D The problem is as follows: I need to produce a report to calculate. I have the following tables:
Contract (ContractNumber, employee, initialSalary, DateOfEnrolment) Salary increase (ContractNumberId, AmountIncrease, DateIncrease)
I need to produce a table that calculates the current salary for every PayrollPeriod. Columns being (ContractNumer, InitialSalary, AmountIncrease, FinalSalary) Rows being (PayrollPeriods)
Of course row1 is easy to calculate (FinalSalary=InitialSalary+AmountIncrease). The problem appears in row2 onwards, when we should have InitialSalary(wor2)=FinalSalary(row1). Since FinalSalary is a value created in the query, I don't know how to get rround it. Anyone knows how that could be done?
|