use of com.intel.mtwilson.as.data.TblLocationPcr in project OpenAttestation by OpenAttestation.
the class TblLocationPcrJpaController method findTblLocationPcrByPcrValueEx.
public TblLocationPcr findTblLocationPcrByPcrValueEx(String pcrValue) {
EntityManager em = getEntityManager();
try {
Query query = em.createNamedQuery("TblLocationPcr.findByPcrValue");
query.setParameter("pcrValue", pcrValue);
query.setHint(QueryHints.REFRESH, HintValues.TRUE);
query.setHint(QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache);
try {
TblLocationPcr locationPcr = (TblLocationPcr) query.getSingleResult();
return locationPcr;
} catch (NoResultException e) {
log.info("NoResultException: Location does not exist for pcr value {} ", pcrValue);
return null;
}
} finally {
em.close();
}
}
Aggregations