Package io.micronaut.data.jpa.repository
Interface JpaRepository<E,ID>
-
- Type Parameters:
E
- The entity typeID
- 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 includesCrudRepository
andPageableRepository
.- Since:
- 1.0.0
- Author:
- graemerocher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<E>
findAll()
Returns all instances of the type.java.util.List<E>
findAll(Sort sort)
Find all results for the given sort order.void
flush()
Adds a flush method.<S extends E>
Sload(@NotNull java.io.Serializable id)
Adds a load method.<S extends E>
java.util.List<S>saveAll(@Valid @NotNull java.lang.Iterable<S> entities)
Saves all given entities, possibly returning new instances representing the saved state.<S extends E>
SsaveAndFlush(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 Detail
-
saveAll
@NonNull <S extends E> java.util.List<S> saveAll(@NonNull @Valid @NotNull @Valid @NotNull java.lang.Iterable<S> entities)
Description copied from interface:CrudRepository
Saves all given entities, possibly returning new instances representing the saved state.- Specified by:
saveAll
in interfaceCrudRepository<E,ID>
- Type Parameters:
S
- The generic type- Parameters:
entities
- The entities to saved. Must not be null.- Returns:
- The saved entities objects. will never be null.
-
findAll
@NonNull java.util.List<E> findAll()
Description copied from interface:CrudRepository
Returns all instances of the type.- Specified by:
findAll
in interfaceCrudRepository<E,ID>
- Returns:
- all entities
-
findAll
@NonNull java.util.List<E> findAll(@NonNull Sort sort)
Description copied from interface:PageableRepository
Find all results for the given sort order.- Specified by:
findAll
in interfacePageableRepository<E,ID>
- Parameters:
sort
- The sort- Returns:
- The iterable results
-
saveAndFlush
@QueryHint(name="javax.persistence.FlushModeType", value="AUTO") <S extends E> S saveAndFlush(@NonNull @Valid @NotNull 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 @NotNull @NotNull java.io.Serializable id)
Adds a load method.- Type Parameters:
S
- the entity type- Parameters:
id
- the entity ID- Returns:
- An uninitialized proxy
-
-