+ Integer numberOfResults = dao.countNameRelationships(name, NameRelationship.Direction.relatedTo, type);\r
+\r
+ List<NameRelationship> results = new ArrayList<NameRelationship>();\r
+ if (numberOfResults > 0) { // no point checking again\r
+ results = dao.getNameRelationships(name, NameRelationship.Direction.relatedTo, type, pageSize, pageNumber,\r
+ orderHints, propertyPaths);\r
+ }\r
+ return results;\r
+ }\r
+ \r
+ public Pager<NameRelationship> pageToNameRelationships(TaxonNameBase name, NameRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {\r
+ Integer numberOfResults = dao.countNameRelationships(name, NameRelationship.Direction.relatedTo, type);\r
+\r
+ List<NameRelationship> results = new ArrayList<NameRelationship>();\r
+ if (numberOfResults > 0) { // no point checking again\r
+ results = dao.getNameRelationships(name, NameRelationship.Direction.relatedTo, type, pageSize, pageNumber,\r
+ orderHints, propertyPaths);\r
+ }\r
+\r
+ return new DefaultPagerImpl<NameRelationship>(pageNumber, numberOfResults, pageSize, results);\r
+ }\r
+\r
+ \r
+ public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status, \r
+ Integer pageSize, Integer pageNumber) { \r
+ return getTypeDesignations(name, status, pageSize, pageNumber, null);\r
+ }\r
+ \r
+ public Pager<TypeDesignationBase> getTypeDesignations(TaxonNameBase name, SpecimenTypeDesignationStatus status, \r
+ Integer pageSize, Integer pageNumber, List<String> propertyPaths){\r