Class CollectionRepositoryImpl
java.lang.Object
de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingSortingFilteringRepositoryImpl
de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl<U>
de.digitalcollections.cudami.server.backend.impl.jdbi.UniqueObjectRepositoryImpl<I>
de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.IdentifiableRepositoryImpl<E>
de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.entity.EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.entity.CollectionRepositoryImpl
- All Implemented Interfaces:
CollectionRepository,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>,IdentifiableRepository<de.digitalcollections.model.identifiable.entity.Collection>,NodeRepository<de.digitalcollections.model.identifiable.entity.Collection>,PagingSortingFilteringRepository<de.digitalcollections.model.identifiable.entity.Collection>,UniqueObjectRepository<de.digitalcollections.model.identifiable.entity.Collection>
@Repository
public class CollectionRepositoryImpl
extends EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
implements CollectionRepository
-
Field Summary
FieldsFields inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.UniqueObjectRepositoryImpl
additionalReduceRowsBiConsumer, basicReduceRowsBiConsumer, fullReduceRowsBiConsumer, uniqueObjectImplClassFields inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
dbi, mappingPrefix, tableAlias, tableNameFields inherited from class de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingSortingFilteringRepositoryImpl
offsetForAlternativePaging -
Constructor Summary
ConstructorsConstructorDescriptionCollectionRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig, IdentifierRepository identifierRepository, UrlAliasRepository urlAliasRepository) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChildren(UUID parentUuid, List<UUID> childrenUuids) booleanaddDigitalObjects(UUID collectionUuid, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) de.digitalcollections.model.identifiable.entity.Collectioncreate()de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findChildren(UUID uuid, de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject>findDigitalObjects(UUID collectionUuid, de.digitalcollections.model.list.paging.PageRequest pageRequest) List<de.digitalcollections.model.identifiable.entity.agent.CorporateBody>findRelatedCorporateBodies(UUID uuid, de.digitalcollections.model.list.filtering.Filtering filtering) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.agent.CorporateBody>findRelatedCorporateBodies(UUID uuid, de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findRootNodes(de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.view.BreadcrumbNavigationgetBreadcrumbNavigation(UUID nodeUuid) de.digitalcollections.model.identifiable.entity.CollectiongetByIdentifier(de.digitalcollections.model.identifiable.Identifier identifier) de.digitalcollections.model.identifiable.entity.CollectiongetByRefId(long refId) de.digitalcollections.model.identifiable.entity.CollectiongetByUuidAndFiltering(UUID uuid, de.digitalcollections.model.list.filtering.Filtering filtering) List<de.digitalcollections.model.identifiable.entity.Collection>getChildren(UUID uuid) getColumnName(String modelProperty) de.digitalcollections.model.identifiable.entity.CollectionList<de.digitalcollections.model.identifiable.entity.Collection>getParents(UUID uuid) protected Stringprotected StringDo not change order! Must match order in getSqlInsertFields!!!getSqlSelectAllFields(String tableAlias, String mappingPrefix) SQL-snippet for fields to be returned for complete field request.
If already all fields are returned with reduced fields request: just return reduced field set here, otherwise add additional fields to reduced set to get all fields.getSqlSelectReducedFields(String tableAlias, String mappingPrefix) protected StringbooleanremoveChild(UUID parentUuid, UUID childUuid) booleanremoveDigitalObject(UUID collectionUuid, UUID digitalObjectUuid) booleanremoveDigitalObjectFromAllCollections(UUID digitalObjectUuid) de.digitalcollections.model.identifiable.entity.CollectionsaveWithParent(UUID childUuid, UUID parentUuid) booleansetDigitalObjects(UUID collectionUuid, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) booleanupdateChildrenOrder(UUID parentUuid, List<UUID> children) Methods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.entity.EntityRepositoryImpl
addRelatedFileresource, findRelatedEntities, findRelatedFileResources, getJsonbFields, getRandom, getReturnedFieldsOnInsertUpdate, hasSplitColumn, insertUpdateCallback, isRepoForNamedEntity, save, setRelatedFileResources, update, updateMethods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.IdentifiableRepositoryImpl
addCrossTablePagingAndSorting, addRelatedEntity, createAdditionalReduceRowsBiConsumer, createBasicReduceRowsBiConsumer, createFullReduceRowsBiConcumer, deleteByUuids, extendReducedIdentifiable, find, findByLanguageAndInitial, getByIdentifier, getLanguages, retrieveList, retrieveList, retrieveOne, setRelatedEntities, supportsCaseSensitivityForPropertyMethods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.UniqueObjectRepositoryImpl
deleteByUuid, execSelectForList, extractUuids, find, find, find, getIndex, getIndex, getSqlSelectAllFields, getSqlSelectAllFieldsJoins, getSqlSelectReducedFields, getSqlSelectReducedFieldsJoins, getUniqueField, retrieveCount, retrieveOne, retrieveOne, save, sqlSelectReducedFieldsMethods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
addFiltering, addFiltering, count, count, escapeTermForJsonpath, execUpdateWithList, execUpdateWithMap, filterByLocalizedTextFields, filterBySplitField, getMappingPrefix, getTableAlias, getTableName, getTargetExpression, getWhereClause, getWhereClauses, mapFilterExpressionsToOtherTableColumnNames, retrieveNextSortIndexForParentChildren, splitToArray, splitToArrayMethods inherited from class de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingSortingFilteringRepositoryImpl
addOrderBy, addPagingAndSorting, getOrderByMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.entity.CollectionRepository
addDigitalObject, addDigitalObjects, findDigitalObjects, findRelatedCorporateBodies, removeDigitalObject, removeDigitalObjectFromAllCollections, setDigitalObjectsMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.entity.EntityRepository
setRelatedEntitiesMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.IdentifiableRepository
addRelatedEntity, addRelatedEntity, addRelatedFileresource, addRelatedFileresource, findByLanguageAndInitial, findRelatedEntities, findRelatedEntities, findRelatedFileResources, findRelatedFileResources, getByIdentifiable, getByIdentifier, getLanguages, setRelatedEntities, setRelatedFileResources, setRelatedFileResourcesMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.NodeRepository
addChild, addChild, addChildren, findChildren, getBreadcrumbNavigation, getChildren, getParent, getParents, removeChild, saveWithParent, updateChildrenOrderMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.PagingSortingFilteringRepository
findMethods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.UniqueObjectRepository
count, delete, delete, deleteByUuid, deleteByUuids, getByExample, getByExampleAndFiltering, getByUuid, getRandom, save, save, saveOrUpdate, update, update
-
Field Details
-
MAPPING_PREFIX
- See Also:
-
TABLE_ALIAS
- See Also:
-
TABLE_NAME
- See Also:
-
-
Constructor Details
-
CollectionRepositoryImpl
public CollectionRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, CudamiConfig cudamiConfig, IdentifierRepository identifierRepository, UrlAliasRepository urlAliasRepository)
-
-
Method Details
-
addChildren
- Specified by:
addChildrenin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
addDigitalObjects
public boolean addDigitalObjects(UUID collectionUuid, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) throws RepositoryException - Specified by:
addDigitalObjectsin interfaceCollectionRepository- Throws:
RepositoryException
-
create
public de.digitalcollections.model.identifiable.entity.Collection create() throws RepositoryException- Specified by:
createin interfaceUniqueObjectRepository<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
createin classIdentifiableRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
findChildren
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findChildren(UUID uuid, de.digitalcollections.model.list.paging.PageRequest pageRequest) throws RepositoryException - Specified by:
findChildrenin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
findDigitalObjects
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> findDigitalObjects(UUID collectionUuid, de.digitalcollections.model.list.paging.PageRequest pageRequest) throws RepositoryException - Specified by:
findDigitalObjectsin interfaceCollectionRepository- Throws:
RepositoryException
-
findRelatedCorporateBodies
public List<de.digitalcollections.model.identifiable.entity.agent.CorporateBody> findRelatedCorporateBodies(UUID uuid, de.digitalcollections.model.list.filtering.Filtering filtering) throws RepositoryException - Specified by:
findRelatedCorporateBodiesin interfaceCollectionRepository- Throws:
RepositoryException
-
findRelatedCorporateBodies
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.agent.CorporateBody> findRelatedCorporateBodies(UUID uuid, de.digitalcollections.model.list.paging.PageRequest pageRequest) - Specified by:
findRelatedCorporateBodiesin interfaceCollectionRepository
-
findRootNodes
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findRootNodes(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws RepositoryException - Specified by:
findRootNodesin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getAllowedOrderByFields
- Overrides:
getAllowedOrderByFieldsin classEntityRepositoryImpl<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
-
getByIdentifier
public de.digitalcollections.model.identifiable.entity.Collection getByIdentifier(de.digitalcollections.model.identifiable.Identifier identifier) throws RepositoryException - Specified by:
getByIdentifierin interfaceIdentifiableRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getByRefId
public de.digitalcollections.model.identifiable.entity.Collection getByRefId(long refId) throws RepositoryException - Specified by:
getByRefIdin interfaceEntityRepository<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getByRefIdin classEntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getByUuidAndFiltering
public de.digitalcollections.model.identifiable.entity.Collection getByUuidAndFiltering(UUID uuid, de.digitalcollections.model.list.filtering.Filtering filtering) throws RepositoryException - Specified by:
getByUuidAndFilteringin interfaceUniqueObjectRepository<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getByUuidAndFilteringin classUniqueObjectRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getChildren
public List<de.digitalcollections.model.identifiable.entity.Collection> getChildren(UUID uuid) throws RepositoryException - Specified by:
getChildrenin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getColumnName
- Overrides:
getColumnNamein classEntityRepositoryImpl<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) throws RepositoryException - Specified by:
getParentin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getParents
public List<de.digitalcollections.model.identifiable.entity.Collection> getParents(UUID uuid) throws RepositoryException - Specified by:
getParentsin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
getRootNodesLanguages
- Specified by:
getRootNodesLanguagesin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
-
getSqlInsertFields
- Overrides:
getSqlInsertFieldsin classEntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Returns:
- SQL for field names for insert statement of
UniqueObject
-
getSqlInsertValues
Description copied from class:UniqueObjectRepositoryImplDo not change order! Must match order in getSqlInsertFields!!!- Overrides:
getSqlInsertValuesin classEntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Returns:
- SQL for value mapping for field names for insert statement of
UniqueObject
-
getSqlSelectAllFields
Description copied from class:IdentifiableRepositoryImplSQL-snippet for fields to be returned for complete field request.
If already all fields are returned with reduced fields request: just return reduced field set here, otherwise add additional fields to reduced set to get all fields.- Overrides:
getSqlSelectAllFieldsin classEntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Returns:
- SQL snippet
-
getSqlSelectReducedFields
- Overrides:
getSqlSelectReducedFieldsin classEntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>- Returns:
- SQL for fields of reduced field set of
UniqueObject
-
getSqlUpdateFieldValues
- Overrides:
getSqlUpdateFieldValuesin classEntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Collection>
-
removeChild
- Specified by:
removeChildin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
-
removeDigitalObject
- Specified by:
removeDigitalObjectin interfaceCollectionRepository
-
removeDigitalObjectFromAllCollections
public boolean removeDigitalObjectFromAllCollections(UUID digitalObjectUuid) throws RepositoryException - Specified by:
removeDigitalObjectFromAllCollectionsin interfaceCollectionRepository- Throws:
RepositoryException
-
saveWithParent
public de.digitalcollections.model.identifiable.entity.Collection saveWithParent(UUID childUuid, UUID parentUuid) throws RepositoryException - Specified by:
saveWithParentin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
RepositoryException
-
setDigitalObjects
public boolean setDigitalObjects(UUID collectionUuid, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) - Specified by:
setDigitalObjectsin interfaceCollectionRepository
-
updateChildrenOrder
- Specified by:
updateChildrenOrderin interfaceNodeRepository<de.digitalcollections.model.identifiable.entity.Collection>
-