Interface CrudService<T extends CollectionEntity>

All Known Subinterfaces:
CollectionEntityService<T>, CollectionService, InstitutionService

public interface CrudService<T extends CollectionEntity>
Base CRUD service for CollectionEntity entities.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(T entity)
    Creates a new entity.
    void
    delete(@NotNull UUID key)
    Deletes an entity by key.
    boolean
    exists(@NotNull UUID key)
    Checks if there is an entity with the key received.
    get(@NotNull UUID key)
    Retrieves an entity by its key.
    void
    update(T entity)
    Updates an existing entity.
  • Method Details

    • create

      UUID create(@NotNull @Valid T entity)
      Creates a new entity.
      Parameters:
      entity - to create
      Returns:
      UUID of the created entity.
    • delete

      void delete(@NotNull @NotNull UUID key)
      Deletes an entity by key.
      Parameters:
      key - of the entity to be deleted.
    • get

      T get(@NotNull @NotNull UUID key)
      Retrieves an entity by its key.
      Parameters:
      key - of the entity to be retrieved.
      Returns:
      the entity
    • update

      void update(@NotNull @Valid T entity)
      Updates an existing entity.
      Parameters:
      entity - that will replace the existing entity.
    • exists

      boolean exists(@NotNull @NotNull UUID key)
      Checks if there is an entity with the key received.
      Parameters:
      key - of the entity to be retrieved.
      Returns:
      true if found, false otherwise