Class DatabaseStorageService

    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • allowedFields

        private static final Set<String> allowedFields
      • namedParameterJdbcTemplate

        private org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate namedParameterJdbcTemplate
    • Constructor Detail

      • DatabaseStorageService

        public DatabaseStorageService()
    • Method Detail

      • store

        @Transactional
        public void store​(StorageContext storageContext)
        Description copied from interface: StorageService
        Stores a study element.
        Parameters:
        storageContext - a context including the study element
      • markDeleted

        @Transactional
        public void markDeleted​(StorageContext storageContext)
        Description copied from interface: StorageService
        Marks a study element as deleted
        Parameters:
        storageContext - a context including the study element identification
      • storeElementOrganisations

        private void storeElementOrganisations​(String id,
                                               String type,
                                               Set<String> organisationCodes)
      • exists

        public boolean exists​(String id,
                              String type)
        Parameters:
        id - study element id
        type - study element type
        Returns:
        true, if the study element defined by type and id exists in the storage
      • get

        public <T> T get​(String id,
                         String type,
                         Class<T> clazz,
                         ElementDeleteMarker deleteMarker)
        Description copied from interface: StorageService
        Get one element from storage.
        Type Parameters:
        T - study element or null
        Parameters:
        id - study element id
        type - study element type
        Returns:
      • search

        public <T> StorageSearchResult<T> search​(StorageQuery query,
                                                 Class<T> clazz,
                                                 ElementDeleteMarker deleteMarker)
        Description copied from interface: StorageService
        Query study elements from the storage
        Type Parameters:
        T - the type used for representing the study elements
        Parameters:
        query - the query object
        clazz - the class used for representing study elements
        Returns:
        the result of the query in a result object
      • setDataSource

        public void setDataSource​(DataSource dataSource)