#921: EmployeeDO.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeDO.kt Type: JPA Entity (Data Object) · Purpose: Represents an employee — the link between a ProjectForge user and financial/HR data · Path: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/EmployeeDO.kt 230 lines · 156 code · 52 comments · 22 blank
Central entity connecting a PFUserDO (user account) to financial, HR, and time-tracking data. Mapped to table t_fibu_employee. Implements Comparable (by user lastname/firstname) and DisplayNameCapable (delegates to user's fullname). Declared open for Hibernate proxy support and test mocking (VacationServiceTest).

Architecture & Design

JPA Mapping

FieldDB ColumnTypeNotes
useruser_idPFUserDO (ManyToOne, LAZY)Unique constraint — one user per employee. Hibernate Search indexed embedded (depth 1). Serialized as ID-only.
kost1kost1_idKost1DO (ManyToOne, LAZY)Cost center for monthly reporting. Nullable.
statusEmployeeStatus? (@Transient)NOT persisted — set by EmployeeDao/EmployeeCache from ValidSinceAttr. Internal setter.
annualLeaveBigDecimal? (@Transient)NOT persisted — annual leave days from ValidSinceAttr. Internal setter.
weeklyWorkingHoursBigDecimal? (@Transient)NOT persisted — weekly hours from ValidSinceAttr. Internal setter.
positionposition_textString (max 244)Job title / position text. Full-text indexed.
eintrittsDatumeintrittLocalDate?Entry/start date. Generic field indexed.
austrittsDatumaustrittLocalDate?Exit/quit date. Generic field indexed.
abteilungabteilungString (max 255)Division/department. Full-text indexed.
staffNumberstaff_numberString (max 255)Staff/personnel number. Alphanumeric sort.
commentcommentStringLength defined by Constants.COMMENT_LENGTH.

Named Queries

Computed Properties

Comparison & Equality

Copy Values

copyValuesFrom() override excludes timeableAttributes from copying. Logs a warning that timeable-attribute copy is not yet implemented.

Git History

868d6abb7 2025 -> 2026
28efde264 Employee: weeklyWorkingHours now as time-dependent attr.
63081666f Source file headers: 2024-> 2025.
0237d5eba Json serialization refactored: IdOnlySerializer and IdsOnlySerializer introduced.
c8f8ed935 Declared all entities as FetchType.LAZY (was EAGER).
4c04cfd65 MAJOR-CHANGE! Migration of integer id's to Long id's
8bd740775 Employee: bank account, birthday, gender and address removed.
a5a0e2b40 EmployeeDO.status will be set by timeableAttribute "status"
a0affa511 EmployeeDO.active
6712fba40 Employee.urlaubstage -> timed attribute for annual leave days.
f070a11e8 Employee.birthday/eintrittsdatum/austrittsdatum: Date -> LocalDate
8675a1dbe Declared all Kotlin JPA entities and their properties as open.
...