import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;\r
import eu.etaxonomy.cdm.model.common.Marker;\r
import eu.etaxonomy.cdm.model.common.MarkerType;\r
+import eu.etaxonomy.cdm.model.common.User;\r
import eu.etaxonomy.cdm.persistence.dao.hibernate.common.MarkerDaoImpl;\r
import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
\r
@Service\r
-@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)\r
+@Transactional(readOnly = true)\r
public class MarkerServiceImpl extends VersionableServiceBase<Marker, MarkerDaoImpl> implements IMarkerService {\r
\r
@Autowired\r
Integer numberOfResults = dao.count(markerType);\r
\r
List<Marker> results = new ArrayList<Marker>();\r
- if(numberOfResults > 0) { // no point checking again\r
+ if(numberOfResults > 0) { // no point checking again //TODO use AbstractPagerImpl.hasResultsInRange(numberOfResults, pageNumber, pageSize)\r
results = dao.list(markerType, pageSize, pageNumber, orderHints, propertyPaths);\r
}\r
\r
return new DefaultPagerImpl<Marker>(pageNumber, numberOfResults, pageSize, results);\r
}\r
\r
+ public Pager<Marker> list(User creator, MarkerType markerType,Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
+ Integer numberOfResults = dao.count(creator,markerType);\r
+ \r
+ List<Marker> results = new ArrayList<Marker>();\r
+ if(numberOfResults > 0) { // no point checking again //TODO use AbstractPagerImpl.hasResultsInRange(numberOfResults, pageNumber, pageSize)\r
+ results = dao.list(creator,markerType, pageSize, pageNumber, orderHints, propertyPaths);\r
+ }\r
+ \r
+ return new DefaultPagerImpl<Marker>(pageNumber, numberOfResults, pageSize, results);\r
+ }\r
+\r
+ public int count(User creator, MarkerType markerType) {\r
+ return dao.count(creator,markerType);\r
+ }\r
}\r
+\r