AddressImageDO.ktAddressDO for performance — images are loaded only on demand via named queries.This Kotlin entity was extracted from AddressDO (commit f99817436) to improve performance through lazy loading. Key design aspects:
T_ADDRESS_IMAGE, mapped to the AddressDO parent via a @OneToOne with FetchType.LAZY.image (full-size) and imagePreview (thumbnail) are both annotated with @Basic(fetch = FetchType.LAZY), preventing heavy BLOB data from loading in list views. Named queries SELECT_WITHOUT_IMAGES and SELECT_IMAGE_ONLY provide selective retrieval.ImageType (JPG, GIF, PNG) stored as a 5-char string column.address back-reference uses @JsonSerialize(using = IdOnlySerializer::class) — when serialized to JSON (REST API), only the address.id is emitted, preventing circular serialization and deep object graphs.@Indexed annotation is not present on this entity, implying that address images are indexed implicitly through their parent AddressDO (which is registered in the full-text search index).| Query | Purpose |
|---|---|
SELECT_WITHOUT_IMAGES | Fetch image metadata (ID, type, lastUpdate) without BLOB data — used in list views |
SELECT_IMAGE_ONLY | Fetch full image BLOB — used for image download |
SELECT_IMAGE_PREVIEW_ONLY | Fetch preview/thumbnail BLOB — used for gallery views |
DELETE_ALL_IMAGES_BY_ADDRESS_ID | Bulk 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.
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