Interface JpaRepository<E,ID>
- Type Parameters:
E- The entity typeID- The ID type
- All Superinterfaces:
CrudRepository<E,ID>, GenericRepository<E, ID>, PageableRepository<E, ID>
Simple composed repository interface that includes
CrudRepository and PageableRepository.- Since:
- 1.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescription<S extends E>
voiddetach(@NonNull S entity) Detach the given entity from the persistence context.findAll()Returns all instances of the type.Find all results for the given sort order.voidflush()Adds a flush method.<S extends E>
SAdds a load method.<S extends E>
Smerge(@NonNull S entity) Merge the state of the given entity into the current persistence context.<S extends E>
voidpersist(@NonNull S entity) Persist an entity instance into the persistence context.<S extends E>
voidrefresh(@NonNull S entity) Refresh the state of the given entity from the database.<S extends E>
voidremove(@NonNull S entity) Remove the given entity from the persistence context.Saves all given entities, possibly returning new instances representing the saved state.<S extends E>
SsaveAndFlush(@NonNull S entity) Save and perform a flush() of any pending operations.Methods inherited from interface CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, insert, insertAll, save, update, updateAllMethods inherited from interface PageableRepository
findAll
-
Method Details
-
saveAll
Description copied from interface:CrudRepositorySaves all given entities, possibly returning new instances representing the saved state.Each entity is saved independently using the same rules as
CrudRepository.save(Object). This is the default repository save behavior and can be overridden by Micronaut Data configuration.- Specified by:
saveAllin interfaceCrudRepository<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
Description copied from interface:CrudRepositoryReturns all instances of the type.- Specified by:
findAllin interfaceCrudRepository<E,ID> - Returns:
- all entities
-
findAll
Description copied from interface:PageableRepositoryFind all results for the given sort order.- Specified by:
findAllin interfacePageableRepository<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
-
merge
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
-
persist
Persist an entity instance into the persistence context.- Type Parameters:
S- The entity type- Parameters:
entity- entity instance
-
refresh
Refresh the state of the given entity from the database.- Type Parameters:
S- The entity type- Parameters:
entity- entity instance
-
remove
Remove the given entity from the persistence context.- Type Parameters:
S- The entity type- Parameters:
entity- entity instance
-
detach
Detach the given entity from the persistence context.- Type Parameters:
S- The entity type- Parameters:
entity- entity instance
-