Search in sources :

Example 11 with Volume

use of org.ambraproject.rhino.model.Volume in project rhino by PLOS.

the class VolumeCrudServiceImpl method readVolumeByIssue.

@Override
public Volume readVolumeByIssue(Issue issue) {
    return hibernateTemplate.execute(session -> {
        Query query = session.createQuery("FROM Volume WHERE :issue IN ELEMENTS(issues)");
        query.setParameter("issue", issue);
        return (Volume) query.uniqueResult();
    });
}
Also used : Query(org.hibernate.Query) Volume(org.ambraproject.rhino.model.Volume)

Aggregations

Volume (org.ambraproject.rhino.model.Volume)11 RestClientException (org.ambraproject.rhino.rest.RestClientException)5 VolumeIdentifier (org.ambraproject.rhino.identity.VolumeIdentifier)3 Journal (org.ambraproject.rhino.model.Journal)3 VolumeInputView (org.ambraproject.rhino.view.journal.VolumeInputView)3 Transactional (org.springframework.transaction.annotation.Transactional)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ApiImplicitParam (com.wordnik.swagger.annotations.ApiImplicitParam)2 Issue (org.ambraproject.rhino.model.Issue)2 Query (org.hibernate.Query)2 BaseRhinoTest (org.ambraproject.rhino.BaseRhinoTest)1 Doi (org.ambraproject.rhino.identity.Doi)1 IssueIdentifier (org.ambraproject.rhino.identity.IssueIdentifier)1 Comment (org.ambraproject.rhino.model.Comment)1 ResolvedDoiView (org.ambraproject.rhino.view.ResolvedDoiView)1 ArticleOverview (org.ambraproject.rhino.view.article.ArticleOverview)1 IssueOutputView (org.ambraproject.rhino.view.journal.IssueOutputView)1 VolumeOutputView (org.ambraproject.rhino.view.journal.VolumeOutputView)1 Session (org.hibernate.Session)1 Test (org.testng.annotations.Test)1