コード例 #1
0
 public List<Publication> findPublicationsByFilter(Publication publication, SortParam sp) {
   if (sp == null) return findPublicationsByFilter(publication);
   if (!sp.getProperty().toString().matches("[a-z,A-Z,_,0-9]*"))
     throw new IllegalArgumentException(
         "sortParam.property contains not allowed symbols: " + sp.getProperty());
   return publicationDao.findPublicationsByFilter(publication, sp);
 }
コード例 #2
0
 public boolean publicationExists(Publication p) {
   if (p.getId() != null && p.getId() != 0) {
     return publicationDao.findPublicationById(p.getId()) != null;
   }
   if (p.getExternalId() != null
       && p.getExternalId() != 0
       && p.getPublicationSystemId() != null
       && p.getPublicationSystemId() != 0) {
     Publication filter = new Publication();
     filter.setExternalId(p.getExternalId());
     filter.setPublicationSystemId(p.getPublicationSystemId());
     return publicationDao.findPublicationsByFilter(filter).size() >= 1;
   }
   if (p.getIsbn() != null && p.getIsbn() != "") {
     Publication filter = new Publication();
     filter.setIsbn(p.getIsbn());
     return publicationDao.findPublicationsByFilter(filter).size() >= 1;
   }
   return false;
 }
コード例 #3
0
 public List<Publication> findPublicationsByFilter(Publication p) {
   return publicationDao.findPublicationsByFilter(p);
 }