Interface RoomRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Room,Long>, org.springframework.data.jpa.repository.JpaRepository<Room, Long>, org.springframework.data.repository.ListCrudRepository<Room, Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Room, Long>, org.springframework.data.repository.PagingAndSortingRepository<Room, Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Room>, org.springframework.data.repository.Repository<Room, Long>
-
Method Summary
Modifier and TypeMethodDescriptionvoidPermanently removes the givenRoomfrom the database.booleanexistsByNumber(@NonNull String number) Checks whether aRoomwith the givenRoom.numberis present in the database.@NonNull org.springframework.data.domain.Page<Room> findAll(@NonNull org.springframework.data.domain.Pageable pageable) A subset of all Rooms in the database table according to the givenPageable.@NonNull LinkedHashSet<String> Fetches all room numbers present on any Rooms in the database.findRoomByNumber(@NonNull String number) Fetches theRoomwith the specifiedRoom.numberfrom the database table.Methods inherited from interface org.springframework.data.repository.CrudRepository
count, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findAll
-
findRoomByNumber
Fetches theRoomwith the specifiedRoom.numberfrom the database table.- Parameters:
number- The number of the room that is being looked for.- Returns:
- The Room matching the given number, if it exists.
-
findAllRoomNumbers
Fetches all room numbers present on any Rooms in the database.- Returns:
- All room numbers in the database.
-
delete
-
existsByNumber
Checks whether aRoomwith the givenRoom.numberis present in the database.- Parameters:
number- The Room number to check.- Returns:
- True if a Room with the number exists, false otherwise.
-