EN · DE · RU · FR · ES

#826: AddressImageDO.kt

projectforge-business/src/main/kotlin/org/projectforge/business/address/AddressImageDO.kt JPA entity — address images, projectforge-business/src/main/kotlin/org/projectforge/business/address/AddressImageDO.kt 87 lines · 53 code · 25 comments · 9 blank
JPA entity for storing address images (photos, logos) with lazy-loaded BLOBs and preview thumbnails. Separated from AddressDO for performance — images are loaded only on demand via named queries.

Architecture

This Kotlin entity was extracted from AddressDO (commit f99817436) to improve performance through lazy loading. Key design aspects:

Named Queries

QueryPurpose
SELECT_WITHOUT_IMAGESFetch image metadata (ID, type, lastUpdate) without BLOB data — used in list views
SELECT_IMAGE_ONLYFetch full image BLOB — used for image download
SELECT_IMAGE_PREVIEW_ONLYFetch preview/thumbnail BLOB — used for gallery views
DELETE_ALL_IMAGES_BY_ADDRESS_IDBulk delete all images for an address — used during address deletion

The entity supports CardDAV image handling (commit c5b4b738b), making address photos available over the CardDAV protocol alongside vCard data.

Git History

868d6abb7 2025 -> 2026\n63081666f Source file headers: 2024-> 2025.\n0237d5eba Json serialization refactored: IdOnlySerializer and IdsOnlySerializer introduced.\n2bcdfbbc6 WIP: orderbook storage.\n943947aaa Addresses: support of gif and jpeg (also for carddav server).\nc5b4b738b WIP: CardDav server, image handling.\nd6ad9ea38 Migration stuff in progress...\n66ec668f6 Migration stuff in progress...\ne33c8b9c2 Migration stuff in progress...\n06828f490 Migration stuff in progress...\nb6092df09 Copyright 2023 -> 2024\nab45d51fa Copyright 2001-2022 -> 2001-2023.\n5f7ef41b8 Copyright 2021 -> 2022\nf54103172 AddressDao.forceDelete works now also, if images where given.\nceb63e8a1 Source code header: (C) 2001-2021.\nae182f8a1 Github issue #135, performance tuning with JProfiler.\nf99817436 Images of addresses now in separate entity. Improves the performance due to lazy loading.\n7c79f1922 Copyright of source header -> 2020.\naf35917ac More code cleanup\nca5a7c00f Optimize Imports\n05244ff19 CopyRight of all Kotlin file-header updated or created.\nda6eec0f6 AddressAttrDataDO.java -> AddressAttrDataDO.kt\n9ebb88522 Initial commit