CollectionHandler.ktTreeSet, ArrayList, HashSet, PersistentSet, PersistentList) in the CandH framework. Compares src and dest collections to detect added, removed, and kept entries. Supports deep copy of collection entries (when managed by owner entity via @PersistenceBehavior(autoUpdateCollectionEntries=true)), soft-delete via @SoftDeleteCollection, and history tracking for collection changes.collectionManagedBySrcClazz() returns true when:
@NoHistory@JoinColumn, @JoinTable, or @OneToMany(mappedBy=...)| Feature | Description |
|---|---|
| Diff Engine | Uses CollectionUtils.compareCollections() to separate added/removed/kept entries |
| Soft Delete | @SoftDeleteCollection marks entries as deleted instead of removing them, preserving history and avoiding unique constraint violations |
| Entry Reactivation | Detects re-added soft-deleted entries and reactivates them |
| Deep Copy | When autoUpdateCollectionEntries=true, uses copyValues() recursively on kept entries to detect nested modifications |
| Collection Instantiation | Auto-creates matching collection type (TreeSet->TreeSet, HashSet->HashSet, ArrayList->ArrayList) when dest is null |
writeInsertHistoryEntriesForNewCollectionEntries() recursively walks merged collections to create history entries for newly inserted child entities (whose IDs were null before merge). Handles nested collection hierarchies (e.g. invoice → positions → cost assignments).
868d6abb7 2025 -> 2026 a77a6570f WIP: Import of creditor invoices e8a5e51d4 WIP: Import of creditor invoices 2d25df051 User comments on changes: users/groups: clone comments also for history entries 6a32032d6 Hibernate.isInitialized(obj) -> HibernateUtils.isFullyInitialized(obj)