3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.cdm
.api
.service
.molecular
;
12 import java
.util
.ArrayList
;
13 import java
.util
.List
;
15 import org
.apache
.log4j
.Logger
;
16 import org
.hibernate
.criterion
.Criterion
;
17 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
18 import org
.springframework
.stereotype
.Service
;
19 import org
.springframework
.transaction
.annotation
.Transactional
;
21 import eu
.etaxonomy
.cdm
.api
.service
.AnnotatableServiceBase
;
22 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
23 import eu
.etaxonomy
.cdm
.api
.service
.pager
.impl
.AbstractPagerImpl
;
24 import eu
.etaxonomy
.cdm
.api
.service
.pager
.impl
.DefaultPagerImpl
;
25 import eu
.etaxonomy
.cdm
.model
.molecular
.Amplification
;
26 import eu
.etaxonomy
.cdm
.persistence
.dao
.molecular
.IAmplificationDao
;
27 import eu
.etaxonomy
.cdm
.persistence
.dto
.UuidAndTitleCache
;
28 import eu
.etaxonomy
.cdm
.persistence
.query
.MatchMode
;
29 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
37 @Transactional(readOnly
= true)
38 public class AmplificationServiceImpl
extends AnnotatableServiceBase
<Amplification
, IAmplificationDao
> implements IAmplificationService
{
39 @SuppressWarnings("unused")
40 private static final Logger logger
= Logger
.getLogger(AmplificationServiceImpl
.class);
44 protected void setDao(IAmplificationDao dao
) {
49 public List
<UuidAndTitleCache
<Amplification
>> getAmplificationUuidAndLabelCache() {
50 return dao
.getAmplificationUuidAndLabelCache();
54 public Pager
<Amplification
> findByLabelCache(String queryString
, MatchMode matchmode
, List
<Criterion
> criteria
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
){
55 Integer numberOfResults
= dao
.countByTitle(queryString
, matchmode
, criteria
);
57 List
<Amplification
> results
= new ArrayList
<Amplification
>();
58 if(AbstractPagerImpl
.hasResultsInRange(numberOfResults
.longValue(), pageNumber
, pageSize
)) {
59 results
= dao
.findByTitle(queryString
, matchmode
, criteria
, pageSize
, pageNumber
, orderHints
, propertyPaths
);
62 return new DefaultPagerImpl
<Amplification
>(pageNumber
, numberOfResults
, pageSize
, results
);