Skip to content

Commit 3fb282c

Browse files
CopilotTeddyCr
andauthored
fix: restore hydrateHistoryEntities hook after setFieldsInBulk and update javadoc
Agent-Logs-Url: https://github.com/open-metadata/OpenMetadata/sessions/6541c953-9da7-4b9b-9bca-3d3a4792516b Co-authored-by: TeddyCr <13626425+TeddyCr@users.noreply.github.com>
1 parent 08adc3e commit 3fb282c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/EntityRepository.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,7 @@ public final ResultList<T> listEntityHistoryByTimestamp(
22282228

22292229
List<T> entities = JsonUtils.readObjects(jsons, getEntityClass());
22302230
setFieldsInBulk(putFields, entities);
2231+
hydrateHistoryEntities(entities);
22312232

22322233
int total = getVersionCountCached(tableName, startTs, endTs, entityType);
22332234

@@ -2265,14 +2266,14 @@ public final ResultList<T> listEntityHistoryByTimestamp(
22652266
}
22662267

22672268
/**
2268-
* Hook to hydrate entities returned from {@link #listEntityHistoryByTimestamp(long, long, String,
2269-
* String, int)}.
2269+
* Hook called after {@link #setFieldsInBulk} for entities returned from {@link
2270+
* #listEntityHistoryByTimestamp(long, long, String, String, int)}.
22702271
*
2271-
* <p>Default behavior is intentionally lightweight: return the historical snapshots as stored in
2272-
* the extension table and avoid expensive relationship re-hydration for each row.
2272+
* <p>Subclasses may override to perform additional, entity-specific hydration of history
2273+
* snapshots without overriding the core field-population logic in {@code setFieldsInBulk}.
22732274
*/
22742275
protected void hydrateHistoryEntities(List<T> entities) {
2275-
// Historical snapshots are already serialized versions; avoid N+1 hydration on /history.
2276+
// No additional hydration by default.
22762277
}
22772278

22782279
private String decodeAndValidateCursor(String cursor) {

0 commit comments

Comments
 (0)