use of org.mycore.datamodel.classifications2.MCRCategLinkReference_ in project mycore by MyCoRe-Org.
the class MCRCategLinkServiceImpl method getReferences.
@Override
public Collection<MCRCategLinkReference> getReferences(String type) {
EntityManager em = MCREntityManagerProvider.getCurrentEntityManager();
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<MCRCategLinkReference> query = cb.createQuery(MCRCategLinkReference.class);
Root<MCRCategoryLinkImpl> li = query.from(LINK_CLASS);
Path<MCRCategLinkReference> objectReferencePath = li.get(MCRCategoryLinkImpl_.objectReference);
return em.createQuery(query.select(objectReferencePath).where(cb.equal(objectReferencePath.get(MCRCategLinkReference_.type), type))).setHint(QueryHints.READ_ONLY, "true").getResultList();
}
use of org.mycore.datamodel.classifications2.MCRCategLinkReference_ in project mycore by MyCoRe-Org.
the class MCRCategLinkServiceImpl method getLinks.
@Override
public Collection<MCRCategoryLink> getLinks(String type) {
EntityManager em = MCREntityManagerProvider.getCurrentEntityManager();
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<MCRCategoryLink> query = cb.createQuery(MCRCategoryLink.class);
Root<MCRCategoryLinkImpl> li = query.from(LINK_CLASS);
return em.createQuery(query.where(cb.equal(li.get(MCRCategoryLinkImpl_.objectReference).get(MCRCategLinkReference_.type), type))).setHint(QueryHints.READ_ONLY, "true").getResultList();
}
Aggregations