Committing large number of changes relating to versioning implementation (#108)
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / common / IIdentifiableDao.java
index e8e728cc60dfa55a42019f2cfa7f865111979bed..495d5a28ce9b19dbbacec2b7d5b144114b62f0e9 100644 (file)
@@ -12,10 +12,26 @@ package eu.etaxonomy.cdm.persistence.dao.common;
 import java.util.List;
 
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.LSID;
 import eu.etaxonomy.cdm.model.common.OriginalSource;
 import eu.etaxonomy.cdm.model.media.Rights;
 
-public interface IIdentifiableDao <T extends IdentifiableEntity> extends ICdmEntityDao<T>, ITitledDao<T>{
+public interface IIdentifiableDao <T extends IdentifiableEntity> extends IAnnotatableDao<T>, ITitledDao<T>{
+       
+       /**
+        * Return an object by LSID. NOTE: Because of the fact that LSIDs are supposed to
+        * be globally resolvable, this method behaves in a different way to other methods
+        * 
+        * In short, it attempts to find an object of type T in the current view using the LSID passed. If the LSID passed has a 
+        * revision part, then this will be used in the query, but if not, then it is expected that the request is for the 'current'
+        * version of the object and the revision part will not be used as a matching criteria in the query. 
+        * 
+        * If the object does not appear in the current view (i.e. it has been deleted), then this method will search the history 
+        * tables for a match, again using the revision if it exists, but ignoring it if not.
+        * 
+        *  @param lsid a LifeScience Identifier identifying the desired object
+        */
+       public T find(LSID lsid);
        
        /**
         * Return a count of the sources for this identifiable entity
@@ -52,4 +68,7 @@ public interface IIdentifiableDao <T extends IdentifiableEntity> extends ICdmEnt
         * @return a List of Rights instances
         */
        public List<Rights> getRights(T identifiableEntity, Integer pageSize, Integer pageNumber);
+       
+       // TODO Migrated from IOriginalSourceDao
+       public List<T> findOriginalSourceByIdInSource(String idInSource, String idNamespace);
 }