Bugfix
Detail
#28295
ReferencePreload accesses reference columns that are not defined for the respective object
If, for example, you have a tree table with different object types in the rows, of which one row type defines an inline reference and sorts according to the column that displays this reference, then the preload tries to access an object with the storage implementation of the inline reference that does not even have this column. In the worst case, this results in a ClassCastException, because the cache value of a completely different column is interpreted as the reference key.
Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class com.top_logic.dob.identifier.ObjectKey (java.lang.String is in module java.base of loader 'bootstrap'; com.top_logic.dob.identifier.ObjectKey is in unnamed module of loader 'app') at com.top_logic.knowledge.ByIDReferenceStorageImpl.getCacheValue(ByIDReferenceStorageImpl.java:121) at com.top_logic.knowledge.ByIDReferenceStorageImpl.getReferencedKey(ByIDReferenceStorageImpl.java:104) at com.top_logic.knowledge.KnowledgeReferenceStorageImpl.getReferenceValueKey(KnowledgeReferenceStorageImpl.java:448) at com.top_logic.knowledge.service.db2.AbstractDBKnowledgeItem.lookupKey(AbstractDBKnowledgeItem.java:153) at com.top_logic.knowledge.service.db2.DBKnowledgeItem.lookupKey(DBKnowledgeItem.java:49) at com.top_logic.knowledge.service.db2.DBKnowledgeItem.getReferencedKey(DBKnowledgeItem.java:204) at com.top_logic.knowledge.service.db2.AbstractDBKnowledgeItem.getReferencedKey(AbstractDBKnowledgeItem.java:294) at com.top_logic.model.v5.ReferencePreload.getReferencedKeys(ReferencePreload.java:143) at com.top_logic.model.v5.ReferencePreload.prepare(ReferencePreload.java:81) at com.top_logic.model.export.Preloader.internalPrepare(Preloader.java:55) at com.top_logic.model.export.Preloader.prepare(Preloader.java:50) at com.top_logic.model.export.PreloadOperation.prepare(PreloadOperation.java:40) at com.top_logic.model.export.Preloader.prepare(Preloader.java:42) at com.top_logic.element.layout.grid.AbstractTreeGridBuilder$TreeGridHandler$2.doPrepareRows(AbstractTreeGridBuilder.java:466)