Interface JpaRepository<E,ID>

Type Parameters:
E - The entity type
ID - The ID type
All Superinterfaces:
CrudRepository<E,ID>, GenericRepository<E,ID>, PageableRepository<E,ID>

public interface JpaRepository<E,ID> extends CrudRepository<E,ID>, PageableRepository<E,ID>
Simple composed repository interface that includes CrudRepository and PageableRepository.
Since:
1.0.0
Author:
graemerocher
  • Method Details

    • saveAll

      @NonNull <S extends E> @NonNull List<S> saveAll(@NonNull @NonNull Iterable<S> entities)
      Description copied from interface: CrudRepository
      Saves all given entities, possibly returning new instances representing the saved state.
      Specified by:
      saveAll in interface CrudRepository<E,ID>
      Type Parameters:
      S - The generic type
      Parameters:
      entities - The entities to save. Must not be null.
      Returns:
      The saved entities objects. will never be null.
    • findAll

      @NonNull @NonNull List<E> findAll()
      Description copied from interface: CrudRepository
      Returns all instances of the type.
      Specified by:
      findAll in interface CrudRepository<E,ID>
      Returns:
      all entities
    • findAll

      @NonNull @NonNull List<E> findAll(@NonNull @NonNull Sort sort)
      Description copied from interface: PageableRepository
      Find all results for the given sort order.
      Specified by:
      findAll in interface PageableRepository<E,ID>
      Parameters:
      sort - The sort
      Returns:
      The iterable results
    • saveAndFlush

      @QueryHint(name="jakarta.persistence.FlushModeType", value="AUTO") <S extends E> S saveAndFlush(@NonNull S entity)
      Save and perform a flush() of any pending operations.
      Type Parameters:
      S - The entity generic type
      Parameters:
      entity - The entity
      Returns:
      The entity, possibly mutated
    • flush

      void flush()
      Adds a flush method.
    • load

      <S extends E> S load(@NonNull @NonNull Object id)
      Adds a load method.
      Type Parameters:
      S - the entity type
      Parameters:
      id - the entity ID
      Returns:
      An uninitialized proxy
    • merge

      <S extends E> S merge(@NonNull S entity)
      Merge the state of the given entity into the current persistence context.
      Type Parameters:
      S - The entity type
      Parameters:
      entity - entity instance
      Returns:
      the managed instance that the state was merged to