Interface UniqueObjectRepository<U extends de.digitalcollections.model.UniqueObject>

All Superinterfaces:
PagingSortingFilteringRepository<U>
All Known Subinterfaces:
AgentRepository<A>, ApplicationFileResourceRepository, ArticleRepository, AudioFileResourceRepository, CanyonRepository, CaveRepository, CollectionRepository, ContinentRepository, CorporateBodyRepository, CountryRepository, CreekRepository, DigitalObjectRepository, EntityRepository<E>, EventRepository, FamilyNameRepository, FileResourceMetadataRepository<F>, GeoLocationRepository<G>, GivenNameRepository, HeadwordEntryRepository, HeadwordRepository, HumanSettlementRepository, IdentifiableRepository<I>, IdentifierRepository, IdentifierTypeRepository, ImageFileResourceRepository, ItemRepository, LakeRepository, LicenseRepository, LinkedDataFileResourceRepository, ManifestationRepository, MountainRepository, NodeRepository<N>, OceanRepository, PersonRepository, PredicateRepository, ProjectRepository, RenderingTemplateRepository, RiverRepository, SeaRepository, StillWatersRepository, SubjectRepository, TagRepository, TextFileResourceRepository, TopicRepository, UrlAliasRepository, UserRepository, ValleyRepository, VideoFileResourceRepository, WebpageRepository, WebsiteRepository, WorkRepository

public interface UniqueObjectRepository<U extends de.digitalcollections.model.UniqueObject> extends PagingSortingFilteringRepository<U>
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Return count of UniqueObjects.
    Create a new instance of UniqueObject
    default int
    delete(Set<U> uniqueObjects)
    Delete a list of UniqueObjects
    default boolean
    delete(U uniqueObject)
     
    boolean
    deleteByUuid(UUID uniqueObjectUuid)
    Delete a single UniqueObject by its UUID
    int
    deleteByUuids(List<UUID> uuidList)
    Remove the UniqueObjects with the provided UUIDs (PK).
    default U
    getByExample(U uniqueObject)
    Retrieve one UniqueObjects by given properties in example instance.
    default U
    getByExampleAndFiltering(U uniqueObject, de.digitalcollections.model.list.filtering.Filtering filtering)
    Retrieve a UniqueObject by given properties in example instance and given filtering.
    default List<U>
    getByExamples(List<U> uniqueObjects)
    Retrieve UniqueObjects by given properties in example instances.
    default List<U>
    getByExamplesAndFiltering(List<U> uniqueObjects, de.digitalcollections.model.list.filtering.Filtering filtering)
    Retrieve UniqueObjects by given properties in example instances and given filtering.
    default U
    getByUuid(UUID uniqueObjectUuid)
    Retrieves the UniqueObject with the supplied UUIDs (PK).
    default U
    getByUuidAndFiltering(UUID uniqueObjectUuid, de.digitalcollections.model.list.filtering.Filtering filtering)
     
    default List<U>
    getByUuids(List<UUID> uniqueObjectUuids)
    Retrieves the UniqueObjects with the supplied UUIDs (PK).
    getByUuidsAndFiltering(List<UUID> uniqueObjectUuids, de.digitalcollections.model.list.filtering.Filtering filtering)
     
    getRandom(int count)
     
    default void
    save(U uniqueObject)
    Save an UniqueObject object.
    void
    save(U uniqueObject, Map<String,Object> bindings)
     
    default void
    saveOrUpdate(U uniqueObject)
     
    default void
    update(U uniqueObject)
    Update an existing UniqueObject object.
    void
    update(U uniqueObject, Map<String,Object> bindings)
     

    Methods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.PagingSortingFilteringRepository

    find
  • Method Details

    • count

      long count() throws RepositoryException
      Return count of UniqueObjects.
      Returns:
      the count of UniqueObjects
      Throws:
      RepositoryException
    • create

      U create() throws RepositoryException
      Create a new instance of UniqueObject
      Returns:
      new instance of UniqueObject
      Throws:
      RepositoryException
    • delete

      default int delete(Set<U> uniqueObjects) throws RepositoryException
      Delete a list of UniqueObjects
      Parameters:
      uniqueObjects - a List of UniqueObjects
      Returns:
      count of removed datasets
      Throws:
      RepositoryException
    • delete

      default boolean delete(U uniqueObject) throws RepositoryException
      Throws:
      RepositoryException
    • deleteByUuid

      boolean deleteByUuid(UUID uniqueObjectUuid) throws RepositoryException
      Delete a single UniqueObject by its UUID
      Parameters:
      uniqueObjectUuid - the UUID
      Returns:
      true if the UniqueObject existed and could be deleted or false, if it did not exist and thus could not be deleted
      Throws:
      RepositoryException - in case of an error
    • deleteByUuids

      int deleteByUuids(List<UUID> uuidList) throws RepositoryException
      Remove the UniqueObjects with the provided UUIDs (PK).
      Parameters:
      uuidList - List of unique object UUIDs to remove
      Returns:
      count of removed datasets
      Throws:
      RepositoryException
    • getByExample

      default U getByExample(U uniqueObject) throws RepositoryException
      Retrieve one UniqueObjects by given properties in example instance.
      Parameters:
      uniqueObject - example instance containing unique property (PK: UUID)
      Returns:
      The found UniqueObject or null
      Throws:
      RepositoryException - in case of technical problems
    • getByExamples

      default List<U> getByExamples(List<U> uniqueObjects) throws RepositoryException
      Retrieve UniqueObjects by given properties in example instances.
      Parameters:
      uniqueObjects - example instances containing unique property (PK: UUID)
      Returns:
      List of found UniqueObjects
      Throws:
      RepositoryException - in case of technical problems
    • getByExampleAndFiltering

      default U getByExampleAndFiltering(U uniqueObject, de.digitalcollections.model.list.filtering.Filtering filtering) throws RepositoryException
      Retrieve a UniqueObject by given properties in example instance and given filtering.
      Parameters:
      uniqueObject - example instance containing unique property
      filtering - filtering params
      Returns:
      the found UniqueObject or null
      Throws:
      RepositoryException - in case of problems
    • getByExamplesAndFiltering

      default List<U> getByExamplesAndFiltering(List<U> uniqueObjects, de.digitalcollections.model.list.filtering.Filtering filtering) throws RepositoryException
      Retrieve UniqueObjects by given properties in example instances and given filtering.
      Parameters:
      uniqueObjects - example instances containing unique property
      filtering - filtering params
      Returns:
      List of found UniqueObjects
      Throws:
      RepositoryException - in case of problems
    • getByUuid

      default U getByUuid(UUID uniqueObjectUuid) throws RepositoryException
      Retrieves the UniqueObject with the supplied UUIDs (PK).
      Parameters:
      uniqueObjectUuid - UUID of unique object
      Returns:
      the found UniqueObject or null
      Throws:
      RepositoryException
    • getByUuids

      default List<U> getByUuids(List<UUID> uniqueObjectUuids) throws RepositoryException
      Retrieves the UniqueObjects with the supplied UUIDs (PK).
      Parameters:
      uniqueObjectUuids - UUIDs of unique objects
      Returns:
      list of found UniqueObjects
      Throws:
      RepositoryException
    • getByUuidsAndFiltering

      List<U> getByUuidsAndFiltering(List<UUID> uniqueObjectUuids, de.digitalcollections.model.list.filtering.Filtering filtering) throws RepositoryException
      Throws:
      RepositoryException
    • getByUuidAndFiltering

      default U getByUuidAndFiltering(UUID uniqueObjectUuid, de.digitalcollections.model.list.filtering.Filtering filtering) throws RepositoryException
      Throws:
      RepositoryException
    • getRandom

      List<U> getRandom(int count) throws RepositoryException
      Throws:
      RepositoryException
    • save

      default void save(U uniqueObject) throws RepositoryException
      Save an UniqueObject object.
      Parameters:
      uniqueObject - the unique object to save
      Throws:
      RepositoryException
    • save

      void save(U uniqueObject, Map<String,Object> bindings) throws RepositoryException
      Throws:
      RepositoryException
    • saveOrUpdate

      default void saveOrUpdate(U uniqueObject) throws RepositoryException
      Throws:
      RepositoryException
    • update

      default void update(U uniqueObject) throws RepositoryException
      Update an existing UniqueObject object.
      Parameters:
      uniqueObject - the existing object with changed properties
      Throws:
      RepositoryException
    • update

      void update(U uniqueObject, Map<String,Object> bindings) throws RepositoryException
      Throws:
      RepositoryException