Interface JpaRepository<E,ID>

Type Parameters:
E - The entity type
ID - The ID type
All Superinterfaces:
io.micronaut.data.repository.CrudRepository<E,ID>, io.micronaut.data.repository.GenericRepository<E,ID>, io.micronaut.data.repository.PageableRepository<E,ID>

public interface JpaRepository<E,ID> extends io.micronaut.data.repository.CrudRepository<E,ID>, io.micronaut.data.repository.PageableRepository<E,ID>
Simple composed repository interface that includes CrudRepository and PageableRepository.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull List<E>
     
    @NonNull List<E>
    findAll(@NonNull io.micronaut.data.model.Sort sort)
     
    void
    Adds a flush method.
    <S extends E>
    S
    load(@NonNull Object id)
    Adds a load method.
    <S extends E>
    S
    merge(S entity)
    Merge the state of the given entity into the current persistence context.
    <S extends E>
    @NonNull List<S>
    saveAll(@NonNull Iterable<S> entities)
     
    <S extends E>
    S
    saveAndFlush(S entity)
    Save and perform a flush() of any pending operations.

    Methods inherited from interface io.micronaut.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save, update, updateAll

    Methods inherited from interface io.micronaut.data.repository.PageableRepository

    findAll
  • Method Details

    • saveAll

      @NonNull <S extends E> @NonNull List<S> saveAll(@NonNull @NonNull Iterable<S> entities)
      Specified by:
      saveAll in interface io.micronaut.data.repository.CrudRepository<E,ID>
    • findAll

      @NonNull @NonNull List<E> findAll()
      Specified by:
      findAll in interface io.micronaut.data.repository.CrudRepository<E,ID>
    • findAll

      @NonNull @NonNull List<E> findAll(@NonNull @NonNull io.micronaut.data.model.Sort sort)
      Specified by:
      findAll in interface io.micronaut.data.repository.PageableRepository<E,ID>
    • 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