use of org.nhindirect.config.store.TrustBundleAnchor in project nhin-d by DirectProject.
the class TrustBundleDaoImpl method getTrustBundleById.
/**
* {@inheritDoc}
*/
@Override
@Transactional(readOnly = true)
public TrustBundle getTrustBundleById(long id) throws ConfigurationStoreException {
validateState();
try {
Query select = entityManager.createQuery("SELECT tb from TrustBundle tb WHERE tb.id = ?1");
select.setParameter(1, id);
TrustBundle rs = (TrustBundle) select.getSingleResult();
// make sure the anchors are loaded
if (!rs.getTrustBundleAnchors().isEmpty())
for (TrustBundleAnchor anchor : rs.getTrustBundleAnchors()) anchor.getData();
return rs;
} catch (NoResultException e) {
return null;
} catch (Exception e) {
throw new ConfigurationStoreException("Failed to execute trust bundle DAO query.", e);
}
}
use of org.nhindirect.config.store.TrustBundleAnchor in project nhin-d by DirectProject.
the class TrustBundleDaoImpl method getTrustBundleByName.
/**
* {@inheritDoc}
*/
@Override
@Transactional(readOnly = true)
public TrustBundle getTrustBundleByName(String bundleName) throws ConfigurationStoreException {
validateState();
try {
Query select = entityManager.createQuery("SELECT tb from TrustBundle tb WHERE UPPER(tb.bundleName) = ?1");
select.setParameter(1, bundleName.toUpperCase(Locale.getDefault()));
TrustBundle rs = (TrustBundle) select.getSingleResult();
// make sure the anchors are loaded
if (!rs.getTrustBundleAnchors().isEmpty())
for (TrustBundleAnchor anchor : rs.getTrustBundleAnchors()) anchor.getData();
return rs;
} catch (NoResultException e) {
return null;
} catch (Exception e) {
throw new ConfigurationStoreException("Failed to execute trust bundle DAO query.", e);
}
}
Aggregations