cleanup
authorAndreas Müller <a.mueller@bgbm.org>
Tue, 11 May 2021 20:16:12 +0000 (22:16 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Tue, 11 May 2021 20:16:12 +0000 (22:16 +0200)
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/occurrence/OccurrenceDaoHibernateImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ITaxonService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java

index 1230fe766e3af77ae95eb2873f5c02a8b89eabcf..6c33f68e1f6e260f3e905cd7c204ec968d52995e 100644 (file)
@@ -133,7 +133,7 @@ public class OccurrenceDaoHibernateImpl
     @Override\r
     public long countMedia(SpecimenOrObservationBase occurence) {\r
         checkNotInPriorView("OccurrenceDaoHibernateImpl.countMedia(SpecimenOrObservationBase occurence)");\r
-        Query query = getSession().createQuery("select count(media) from SpecimenOrObservationBase occurence join occurence.media media where occurence = :occurence");\r
+        Query query = getSession().createQuery("SELECT count(media) FROM SpecimenOrObservationBase occurence JOIN occurence.media media WHERE occurence = :occurence");\r
         query.setParameter("occurence", occurence);\r
 \r
         return (Long)query.uniqueResult();\r
@@ -142,7 +142,7 @@ public class OccurrenceDaoHibernateImpl
     @Override\r
     public List<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize,Integer pageNumber, List<String> propertyPaths) {\r
         checkNotInPriorView("OccurrenceDaoHibernateImpl.getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize,Integer pageNumber)");\r
-        Query query = getSession().createQuery("select distinct derivationEvent from DerivationEvent derivationEvent join derivationEvent.originals occurence where occurence = :occurence");\r
+        Query query = getSession().createQuery("SELECT DISTINCT derivationEvent FROM DerivationEvent derivationEvent JOIN derivationEvent.originals occurence WHERE occurence = :occurence");\r
         query.setParameter("occurence", occurence);\r
 \r
         addPageSizeAndNumber(query, pageSize, pageNumber);\r
index c36de86ae715b84f41584972d0216adb2f9961b8..a8d63b85763109c0613b2cbf78c99e52ae931639 100644 (file)
@@ -943,60 +943,23 @@ public interface ITaxonService
      */
     public DeleteResult deleteTaxon(UUID taxonUuid, TaxonDeletionConfigurator config, UUID classificationUuid);
 
-
        public UpdateResult moveFactualDateToAnotherTaxon(UUID fromTaxonUuid,
                        UUID toTaxonUuid);
 
-
-    /**
-     * @param synonymUuid
-     * @param toTaxonUuid
-     * @param taxonRelationshipType
-     * @param citation
-     * @param microcitation
-     * @return
-     */
     public UpdateResult changeSynonymToRelatedTaxon(UUID synonymUuid, UUID toTaxonUuid, TaxonRelationshipType taxonRelationshipType,
             Reference citation, String microcitation);
 
-    /**
-     * @param fromTaxonUuid
-     * @param toTaxonUuid
-     * @param oldRelationshipType
-     * @param synonymType
-     * @return
-     * @throws DataChangeNoRollbackException
-     */
     public UpdateResult changeRelatedTaxonToSynonym(UUID fromTaxonUuid, UUID toTaxonUuid,
             TaxonRelationshipType oldRelationshipType, SynonymType synonymType) throws DataChangeNoRollbackException;
 
     /**
      * Returns a list of taxon relationships for a given taxon as DTO.
-     * @param taxonUuid
-     * @param directTypes
-     * @param inversTypes
-     * @param direction
-     * @param groupMisapplications
-     * @param includeUnpublished
-     * @param pageSize
-     * @param pageNumber
-     * @return
      */
     public TaxonRelationshipsDTO listTaxonRelationships(UUID taxonUuid,
             Set<TaxonRelationshipType> directTypes,
             Set<TaxonRelationshipType> inversTypes, Direction direction, boolean groupMisapplications,
             boolean includeUnpublished, Integer pageSize, Integer pageNumber);
 
-    /**
-     * @param clazz
-     * @param restrictions
-     * @param pageSize
-     * @param pageIndex
-     * @param orderHints
-     * @param propertyPaths
-     * @param includeUnpublished
-     * @return
-     */
     public <S extends TaxonBase> Pager<S> page(Class<S> clazz, List<Restriction<?>> restrictions, Integer pageSize, Integer pageIndex,
             List<OrderHint> orderHints, List<String> propertyPaths, boolean includeUnpublished);
 
index 3ad86844e53086939e4ffad63a571f17c93510c8..a003200f736239db2e00293c7ba201defc4a2a83 100644 (file)
@@ -421,8 +421,8 @@ public class TaxonServiceImpl
             }else{
                 logger.warn("Taxon is not part of its own Taxonrelationship");
             }
-            // Remove old relationships
 
+            // Remove old relationships
             fromTaxon.removeTaxonRelation(taxonRelationship);
             toTaxon.removeTaxonRelation(taxonRelationship);
             taxonRelationship.setToTaxon(null);