Interface AuthorRepository
- All Superinterfaces:
CrudRepository<Author,,Long> GenericRepository<Author,,Long> JpaSpecificationExecutor<Author>
public interface AuthorRepository
extends CrudRepository<Author,Long>, JpaSpecificationExecutor<Author>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionlongcountByNameContains(String text) findAll(PredicateSpecification<Author> specification) Returns all entities matching the givenPredicateSpecification.findAllByName(String name, String nickName, Pageable pageable) findAllByNameCustom(String name) findAllByNickName(String nickName, String name, Pageable pageable) findByBooksTitle(String title) findByBooksTotalPages(int totalPages, CursoredPageable pageable) Retrieves an entity by its id.findByName(String name) findByNameContains(String name) findByNameEndsWith(String name) findByNameIgnoreCase(String name) findByNameStartsWith(String name) findOne(PredicateSpecification<Author> specification) Returns a single entity matching the givenPredicateSpecification.findOne(QuerySpecification<Author> specification) Returns a single entity matching the givenQuerySpecification.listAll()queryAll()queryByName(String name) queryByNameContains(String name) read()readAll()@Nullable AuthorretrieveByName(String name) searchByName(String name) voidupdateNickname(Long id, @Nullable String nickName) Methods inherited from interface io.micronaut.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findAll, save, saveAll, update, updateAll
-
Method Details
-
queryByName
-
findById
Description copied from interface:CrudRepositoryRetrieves an entity by its id.- Specified by:
findByIdin interfaceCrudRepository<Author,Long> - Parameters:
aLong- The ID of the entity to retrieve. Must not be null.- Returns:
- the entity with the given id or Optional#empty() if none found
-
findOne
Description copied from interface:JpaSpecificationExecutorReturns a single entity matching the givenPredicateSpecification.- Specified by:
findOnein interfaceJpaSpecificationExecutor<Author>- Parameters:
specification- The query specification- Returns:
- optional found result
-
findAll
Description copied from interface:JpaSpecificationExecutorReturns all entities matching the givenPredicateSpecification.- Specified by:
findAllin interfaceJpaSpecificationExecutor<Author>- Parameters:
specification- The query specification- Returns:
- found results
-
findOne
Description copied from interface:JpaSpecificationExecutorReturns a single entity matching the givenQuerySpecification.- Specified by:
findOnein interfaceJpaSpecificationExecutor<Author>- Parameters:
specification- The query specification- Returns:
- optional found result
-
findByName
-
findByBooksTitle
-
countByNameContains
-
findByNameStartsWith
-
findByNameStartsWithIgnoreCase
-
findByNameContains
-
findByNameContainsIgnoreCase
-
queryByNameContains
-
findByNameEndsWithIgnoreCase
-
findByNameEndsWith
-
findByNameIgnoreCase
-
searchByName
-
retrieveByName
-
listAll
-
findByIdIsNotNull
-
queryByIdIsNotNull
-
findByNameIsNotNull
-
searchAll
List<AuthorDtoWithBooks> searchAll() -
queryAll
List<AuthorDtoWithBooks> queryAll() -
retrieveByIdIsNotNull
List<AuthorDtoWithBooks> retrieveByIdIsNotNull() -
searchByNameIsNotNull
List<AuthorDtoWithBooks> searchByNameIsNotNull() -
readAll
List<AuthorDtoWithBooks> readAll() -
read
List<AuthorDtoWithBooks> read() -
readByIdIsNotNull
List<AuthorDtoWithBooks> readByIdIsNotNull() -
readByNameIsNotNull
List<AuthorDtoWithBooks> readByNameIsNotNull() -
updateNickname
-
findAll
-
findAllByName
-
findAllByNickName
-
findByBooksTotalPages
-
findAllByNameCustom
@Query("SELECT author_.*,\n b_.id AS b_id, b_.author_id AS b_author_id, b_.genre_id AS b_genre_id,\n b_.title AS b_title, b_.total_pages AS b_total_pages, b_.publisher_id AS b_publisher_id,\n b_.last_updated AS b_last_updated\nFROM author author_ INNER JOIN book b_ ON author_.id = b_.author_id\nWHERE author_.name = :name\n") List<Author> findAllByNameCustom(String name)
-