#924: EmployeeSalaryDao.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeSalaryDao.kt Type: Spring Service / DAO · Purpose: Data access for monthly employee salary records · Path: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeSalaryDao.kt 151 lines · 104 code · 33 comments · 14 blank
Extends BaseDao<EmployeeSalaryDO>. Manages monthly salary entries for employees with uniqueness validation on (employee, year, month). Includes year-browsing support via min/max year query. User right: HR_EMPLOYEE_SALARY.

Architecture & Design

Filtering

select(filter) wraps any filter in EmployeeSalaryFilter and applies year/month equality constraints. Results are always ordered by year DESC, month DESC (newest first).

Uniqueness Validation (onInsertOrModify)

On insert (id==null): checks if a salary record already exists for the same (employee, year, month) combination. On update: same check excluding the current record's ID. Throws UserException("fibu.employee.salary.error.salaryAlreadyExist") if a duplicate is found.

Year Range

The years property returns an IntArray of all years present in the salary table, computed from the named query EmployeeSalaryDO.SELECT_MIN_MAX_YEAR via SQLHelper.getYearsByTupleOfYears(). Used for year-navigation in the UI.

Additional Fields

Search extends to employee.user.lastname, employee.user.firstname, and employee.staffNumber.

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
5989b32fd BaseDao: mechanism of onChangeLister refactored.
1b50060c3 BaseDao: renamed: get -> find, save -> insert, getList -> select, load -> select
3aeda5ef5 Big change: all save|update|...InTrans renamed.
85b4e1175 PfPersistenceService and PfPersistenceContext: query renamed to executeQuery.
b095e6f7d Big change of Transaction handling.
4c04cfd65 MAJOR-CHANGE! Migration of integer id's to Long id's
5bafe7941 @Repository -> @Service. @Transactional-Annotations removed.
...