Interface BaseImmutableService<O extends Identifiable>

    • Method Detail

      • findOrCreate

        @CheckReturnValue
        O findOrCreate​(O entity)
        Does a search for the entity in the persistent storage, and if not found, creates it.
        Parameters:
        entity - the entity to look for, and create if not found.
        Returns:
        the entity retrieved from the persistent storage, either found or created.
      • create

        @CheckReturnValue
        Collection<O> create​(Collection<O> entities)
        Creates all the given entities in a persistent storage
        Parameters:
        entities - the entities to be created.
        Returns:
        collection of objects referencing the persistent instances of given entities.
      • create

        @CheckReturnValue
        O create​(O entity)
        Creates the given entity in the persistent storage.
        Parameters:
        entity - the entity to be created.
        Returns:
        object referencing the persistent instance of the given entity.
      • remove

        void remove​(Collection<O> entities)
        Removes all the given entities from persistent storage.
        Parameters:
        entities - the entities to be removed.
      • remove

        void remove​(Long id)
        Removes the entity with given ID from the persistent storage.
        Parameters:
        id - the ID of entity to be removed.
      • remove

        void remove​(O entity)
        Removes the given entity from the persistent storage.
        Parameters:
        entity - the entity to be removed.