#926: EmployeeSalaryService.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeSalaryService.kt Type: Spring Service · Purpose: Service layer for querying employee salary records · Path: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeSalaryService.kt 45 lines · 19 code · 22 comments · 4 blank
Thin service layer wrapping PfPersistenceService. Provides a single query method to retrieve all salary records for a given year and month. Designed for reporting scenarios (monthly salary overview). Uses read-only transactions.

Architecture & Design

Single Method

selectByMonth(year: Int, month: Month): List<EmployeeSalaryDO> — Executes the named query EmployeeSalaryDO.SELECT_SALARIES_BY_MONTH within a read-only transaction via persistenceService.runReadOnly. The Month enum parameter is converted to its integer value (1-12).

Design Note

This is a separate service (not part of EmployeeSalaryDao) for clean separation: the DAO handles CRUD, while this service handles bulk queries for reporting. It directly uses PfPersistenceService rather than the DAO layer, accessing named queries defined on EmployeeSalaryDO.

Git History

868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
1012e347a Migration stuff in progress... (all tests of all packages: OK).
190c0aea1 Migration stuff in progress... (all tests of all packages: OK).
ba2479571 Migration stuff in progress...
b3293f0cc PersistenceService/Context: stats handling improved.
b47c21af6 Refactored caching and calculations with invoices (not yet finished)