#1234: IdObject.kt
projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/api/IdObject.kt Domain Object Interface, projectforge-business/src/main/kotlin/org/projectforge/framework/persistence/api/IdObject.kt 33 lines · 5 code · 25 comments · 3 blank
Fundamental interface for all database entities. Defines a single generic property: id: I? where I extends Serializable. Extends Serializable. Serves as the base of the entire entity hierarchy — BaseDO, HistoryEntry, and all Hibernate entities implement this interface.
Architecture
Interface Contract
interface IdObject<I : Serializable> : Serializable {
var id: I?
}
Usage in the System
- BaseDO extends
IdObject<I> — all persistent entities
- HistoryEntry extends
IdObject<Long> — history records
- IdOnlySerializer — Jackson serializer that reads
id from any IdObject
- BaseDao — uses
IdObject.serializableId for find/update/delete operations
ID Type Flexibility
I is a generic type parameter bounded by Serializable
- Allows Long, Int, String, or composite IDs
- Most entities use
IdObject<Long> after the major migration from Integer to Long IDs
Git History
868d6abb7 2025 -> 2026
63081666f Source file headers: 2024-> 2025.
e33c8b9c2 Migration stuff in progress...
06828f490 Migration stuff in progress...
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
5f7ef41b8 Copyright 2021 -> 2022
0ab100d21 Configuration refactored (GlobalConfiguration not needed anymore).
ceb63e8a1 Source code header: (C) 2001-2021.
7c79f1922 Copyright of source header -> 2020.
dd5ca38ac CopyRight of all java file-header updated or created.
9ebb88522 Initial commit