checkQueryOk();
List<HistoricDetail> historicDetails = commandContext
.getHistoricDetailEntityManager()
.findHistoricDetailsByQueryCriteria(this, page);
HistoricDetailVariableInstanceUpdateEntity varUpdate = null;
if (historicDetails!=null) {
for (HistoricDetail historicDetail: historicDetails) {
if (historicDetail instanceof HistoricDetailVariableInstanceUpdateEntity) {
varUpdate = (HistoricDetailVariableInstanceUpdateEntity)historicDetail;
// Touch byte-array to ensure initialized inside context
// TODO there should be a generic way to initialize variable values
varUpdate.getBytes();
// ACT-863: EntityManagerFactorySession instance needed for fetching value, touch while inside context to store
// cached value
if (varUpdate.getVariableType() instanceof JPAEntityVariableType) {
// Use HistoricJPAEntityVariableType to force caching of value to return from query
varUpdate.setVariableType(HistoricJPAEntityVariableType.getSharedInstance());
varUpdate.getValue();
} else if (varUpdate.getVariableType() instanceof JPAEntityListVariableType) {
// Use HistoricJPAEntityListVariableType to force caching of list to return from query
varUpdate.setVariableType(HistoricJPAEntityListVariableType.getSharedInstance());
varUpdate.getValue();
}
}
}
}
return historicDetails;