Changed DataChangeEvent architecture
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / common / IDefinedTermDao.java
index 401d371afee069deeef7a936e49c923e6db1b1c7..a838a55a9512745fbc13af5ff9d478d27b6cb510 100644 (file)
@@ -12,12 +12,20 @@ package eu.etaxonomy.cdm.persistence.dao.common;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Locale;
+import java.util.Set;
 
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
 import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.description.AbsenceTerm;
+import eu.etaxonomy.cdm.model.description.PresenceTerm;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
+import eu.etaxonomy.cdm.model.location.NamedAreaType;
+import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
+import eu.etaxonomy.cdm.model.media.Media;
 
 
-public interface IDefinedTermDao extends ICdmEntityDao<DefinedTermBase>, ITitledDao<DefinedTermBase>{
+public interface IDefinedTermDao extends IVersionableDao<DefinedTermBase>, ITitledDao<DefinedTermBase>{
        
        /**
         * @param iso639 a two or three letter language code according to iso639-1 or iso639-2
@@ -29,6 +37,103 @@ public interface IDefinedTermDao extends ICdmEntityDao<DefinedTermBase>, ITitled
        public List<Language> getLanguagesByIso(List<String> iso639List);
        
        public List<Language> getLanguagesByLocale(Enumeration<Locale> locales);
-
        
+       public WaterbodyOrCountry getCountryByIso(String iso639);
+       
+       public <TYPE extends DefinedTermBase> List<TYPE> getDefinedTermByRepresentationText(String text, Class<TYPE> clazz );
+       
+    /**
+     * Returns a List of Media that represent a given DefinedTerm instance
+     * 
+        * @param definedTerm the definedTerm represented by these media
+        * @param pageSize The maximum number of media returned (can be null for all related media)
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
+     * @return a List of media instances
+     */
+       public List<Media> getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber);
+       
+       /**
+        * Returns a count of the Media that represent a given 
+        * DefinedTermBase instance
+        * 
+        * @param definedTerm the definedTerm represented by these media
+        * @return a count of Media entities
+        */
+       public int countMedia(DefinedTermBase definedTerm);
+       
+       /**
+        * Returns a List of NamedArea instances (optionally filtered by type or level)
+        * 
+        * @param level restrict the result set to named areas of a certain level (can be null)
+        * @param type restrict the result set to named areas of a certain type (can be null)
+        * @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
+        * @return a List of named areas
+        */
+       public List<NamedArea> list(NamedAreaLevel level, NamedAreaType type, Integer pageSize, Integer pageNumber);
+       
+       /**
+        * Returns a count of NamedArea instances (optionally filtered by type or level)
+        * 
+        * @param level restrict the result set to named areas of a certain level (can be null)
+        * @param type restrict the result set to named areas of a certain type (can be null)
+        * @return a count of named areas
+        */
+       public int count(NamedAreaLevel level, NamedAreaType type);
+       
+       /**
+        * Return a list of terms which are specializations of a given definedTerm
+        * 
+        * @param definedTerm The term which is a generalization of the terms returned
+        * @param pageSize The maximum number of terms returned (can be null for all specializations)
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
+        * @return a List of DefinedTerms
+        */
+       public <T extends DefinedTermBase> List<T> getGeneralizationOf(T definedTerm, Integer pageSize, Integer pageNumber);
+       
+       /**
+        * Return a count of terms which are specializations of a given definedTerm
+        * 
+        * @param definedTerm The term which is a generalization of the terms returned
+        * @return a count of DefinedTerms
+        */
+       public <T extends DefinedTermBase> int countGeneralizationOf(T definedTerm);
+       
+       /**
+        * Return a List of distinct terms which include the terms supplied
+        * 
+        * @param definedTerms the set of terms which are part of the terms of interest 
+        * @param pageSize The maximum number of terms returned (can be null for all terms)
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
+        * @return a List of DefinedTerms
+        */
+       public <T extends DefinedTermBase> List<T> getPartOf(Set<T> definedTerms, Integer pageSize, Integer pageNumber);
+       
+       /**
+        * Return a count of distinct terms which include the terms supplied
+        * 
+        * @param definedTerms the set of terms which are part of the terms of interest 
+        * @return a count of DefinedTerms
+        */
+       public <T extends DefinedTermBase> int countPartOf(Set<T> definedTerms);
+       
+       /**
+        * Return a List of terms which are part of the terms supplied
+        * 
+        * @param definedTerms the set of terms which include the terms of interest 
+        * @param pageSize The maximum number of terms returned (can be null for all terms)
+        * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
+        * @return a List of DefinedTerms
+        */
+       public <T extends DefinedTermBase> List<T> getIncludes(Set<T> definedTerms, Integer pageSize, Integer pageNumber);
+       
+       /**
+        * Return a count of terms which are part of the terms supplied
+        * 
+        * @param definedTerms the set of terms which include the terms of interest 
+        * @return a count of DefinedTerms
+        */
+       public <T extends DefinedTermBase> int countIncludes(Set<T> definedTerms);
+
+       public DefinedTermBase findByUri(String uri);
 }