feat: added getLatestRecord for extension (#18797)

This commit is contained in:
Imri Paran 2024-11-27 11:08:53 +01:00 committed by GitHub
parent c101c7cf30
commit e58efdde67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -282,6 +282,16 @@ public abstract class EntityTimeSeriesRepository<T extends EntityTimeSeriesInter
return entityRecord;
}
public T getLatestRecord(String recordFQN, String extension) {
String jsonRecord = timeSeriesDao.getLatestExtension(recordFQN, extension);
if (jsonRecord == null) {
return null;
}
T entityRecord = JsonUtils.readValue(jsonRecord, entityClass);
setInheritedFields(entityRecord);
return entityRecord;
}
public T getById(UUID id) {
String jsonRecord = timeSeriesDao.getById(id);
if (jsonRecord == null) {