Class CollectionRepositoryImpl

    • Constructor Detail

      • CollectionRepositoryImpl

        @Autowired
        public CollectionRepositoryImpl​(org.jdbi.v3.core.Jdbi dbi,
                                        CudamiConfig cudamiConfig)
    • Method Detail

      • getSqlInsertFields

        public static String getSqlInsertFields()
      • getSqlInsertValues

        public static String getSqlInsertValues()
      • getSqlSelectAllFields

        public static String getSqlSelectAllFields​(String tableAlias,
                                                   String mappingPrefix)
      • getSqlSelectReducedFields

        public static String getSqlSelectReducedFields​(String tableAlias,
                                                       String mappingPrefix)
      • getSqlUpdateFieldValues

        public static String getSqlUpdateFieldValues()
      • addChildren

        public boolean addChildren​(UUID parentUuid,
                                   List<UUID> childrenUuids)
        Specified by:
        addChildren in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • addDigitalObjects

        public boolean addDigitalObjects​(UUID collectionUuid,
                                         List<de.digitalcollections.model.identifiable.entity.DigitalObject> digitalObjects)
        Specified by:
        addDigitalObjects in interface CollectionRepository
      • findChildren

        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findChildren​(UUID uuid,
                                                                                                                                             de.digitalcollections.model.list.paging.PageRequest pageRequest)
        Specified by:
        findChildren in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • findDigitalObjects

        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.DigitalObject> findDigitalObjects​(UUID collectionUuid,
                                                                                                                                                      de.digitalcollections.model.list.paging.PageRequest pageRequest)
        Specified by:
        findDigitalObjects in interface CollectionRepository
      • findRelatedCorporateBodies

        public List<de.digitalcollections.model.identifiable.entity.agent.CorporateBody> findRelatedCorporateBodies​(UUID uuid,
                                                                                                                    de.digitalcollections.model.list.filtering.Filtering filtering)
        Specified by:
        findRelatedCorporateBodies in interface CollectionRepository
      • findRootNodes

        public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findRootNodes​(de.digitalcollections.model.list.paging.PageRequest pageRequest)
        Specified by:
        findRootNodes in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • getAllowedOrderByFields

        protected List<String> getAllowedOrderByFields()
        Overrides:
        getAllowedOrderByFields in class EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
        Returns:
        model properties names that are applicable for sorting, will be mapped to database column names using @see #getColumnName
      • getBreadcrumbNavigation

        public de.digitalcollections.model.view.BreadcrumbNavigation getBreadcrumbNavigation​(UUID nodeUuid)
        Specified by:
        getBreadcrumbNavigation in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • getByIdentifier

        public de.digitalcollections.model.identifiable.entity.Collection getByIdentifier​(de.digitalcollections.model.identifiable.Identifier identifier)
        Specified by:
        getByIdentifier in interface IdentifiableRepository<de.digitalcollections.model.identifiable.entity.Collection>
        Overrides:
        getByIdentifier in class IdentifiableRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
      • getByRefId

        public de.digitalcollections.model.identifiable.entity.Collection getByRefId​(long refId)
        Specified by:
        getByRefId in interface EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>
        Overrides:
        getByRefId in class EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
      • getChildren

        public List<de.digitalcollections.model.identifiable.entity.Collection> getChildren​(UUID uuid)
        Specified by:
        getChildren in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • getColumnName

        public String getColumnName​(String modelProperty)
        Overrides:
        getColumnName in class EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
        Parameters:
        modelProperty - name of model property passed as String, e.g. "lastModified"
        Returns:
        full qualified column name as used in sql queries ("last_modified" or e.g. "w.last_modified" if prefix used in queries)
      • getParent

        public de.digitalcollections.model.identifiable.entity.Collection getParent​(UUID uuid)
        Specified by:
        getParent in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • getParents

        public List<de.digitalcollections.model.identifiable.entity.Collection> getParents​(UUID uuid)
        Specified by:
        getParents in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • removeChild

        public boolean removeChild​(UUID parentUuid,
                                   UUID childUuid)
        Specified by:
        removeChild in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • save

        public de.digitalcollections.model.identifiable.entity.Collection save​(de.digitalcollections.model.identifiable.entity.Collection collection)
        Specified by:
        save in interface IdentifiableRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • saveWithParent

        public de.digitalcollections.model.identifiable.entity.Collection saveWithParent​(UUID childUuid,
                                                                                         UUID parentUuid)
        Specified by:
        saveWithParent in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • setDigitalObjects

        public boolean setDigitalObjects​(UUID collectionUuid,
                                         List<de.digitalcollections.model.identifiable.entity.DigitalObject> digitalObjects)
        Specified by:
        setDigitalObjects in interface CollectionRepository
      • update

        public de.digitalcollections.model.identifiable.entity.Collection update​(de.digitalcollections.model.identifiable.entity.Collection collection)
        Specified by:
        update in interface IdentifiableRepository<de.digitalcollections.model.identifiable.entity.Collection>
      • updateChildrenOrder

        public boolean updateChildrenOrder​(UUID parentUuid,
                                           List<de.digitalcollections.model.identifiable.entity.Collection> children)
        Specified by:
        updateChildrenOrder in interface NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>