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.@NonNull org.springframework.data.domain.Page<Room> findAtLeastPartiallyAccessibleRooms(@NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that haveAccessibility.FULLorAccessibility.PARTIALas theRoom.accessibility.@NonNull org.springframework.data.domain.Page<Room> findAtLeastPartiallyAccessibleRoomsByFloor(int floor, @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor and haveAccessibility.FULLorAccessibility.PARTIALas theRoom.accessibility.@NonNull org.springframework.data.domain.Page<Room> findByFloor(int floor, @NonNull org.springframework.data.domain.Pageable pageable) @NonNull org.springframework.data.domain.Page<Room> findFullyAccessibleRooms(@NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that haveAccessibility.FULLas theRoom.accessibility.@NonNull org.springframework.data.domain.Page<Room> findFullyAccessibleRoomsByFloor(int floor, @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor and haveAccessibility.FULLas theRoom.accessibility.@NonNull org.springframework.data.domain.Page<Room> findInaccessibleRooms(@NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that haveAccessibility.NONEas theRoom.accessibility(or null).@NonNull org.springframework.data.domain.Page<Room> findInaccessibleRoomsByFloor(int floor, @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor and haveAccessibility.NONEas theRoom.accessibility.findRoomByNumber(@NonNull String number) Fetches theRoomwith the specifiedRoom.numberfrom the database table.findRoomIdByNumber(@NonNull String number) 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
-
findByFloor
@NonNull @NonNull org.springframework.data.domain.Page<Room> findByFloor(int floor, @NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor.- Parameters:
floor- The floor whose Rooms are looked for.pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
findFullyAccessibleRooms
@Query("select r from Room r where r.accessibility = 'FULL'") @NonNull @NonNull org.springframework.data.domain.Page<Room> findFullyAccessibleRooms(@NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that haveAccessibility.FULLas theRoom.accessibility.- Parameters:
pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
findFullyAccessibleRoomsByFloor
@Query("select r from Room r where r.floor = :floor and r.accessibility = 'FULL'") @NonNull @NonNull org.springframework.data.domain.Page<Room> findFullyAccessibleRoomsByFloor(int floor, @NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor and haveAccessibility.FULLas theRoom.accessibility.- Parameters:
floor- The floor whose Rooms are looked for.pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
findAtLeastPartiallyAccessibleRooms
@Query("select r from Room r where r.accessibility = 'FULL' or r.accessibility = 'PARTIAL'") @NonNull @NonNull org.springframework.data.domain.Page<Room> findAtLeastPartiallyAccessibleRooms(@NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that haveAccessibility.FULLorAccessibility.PARTIALas theRoom.accessibility.- Parameters:
pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
findAtLeastPartiallyAccessibleRoomsByFloor
@Query("select r from Room r where r.floor = :floor and (r.accessibility = 'FULL' or r.accessibility = 'PARTIAL')") @NonNull @NonNull org.springframework.data.domain.Page<Room> findAtLeastPartiallyAccessibleRoomsByFloor(int floor, @NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor and haveAccessibility.FULLorAccessibility.PARTIALas theRoom.accessibility.- Parameters:
floor- The floor whose Rooms are looked for.pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
findInaccessibleRooms
@Query("select r from Room r where r.accessibility is null or r.accessibility = 'NONE'") @NonNull @NonNull org.springframework.data.domain.Page<Room> findInaccessibleRooms(@NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that haveAccessibility.NONEas theRoom.accessibility(or null).- Parameters:
pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
findInaccessibleRoomsByFloor
@Query("select r from Room r where r.floor = :floor and (r.accessibility is null or r.accessibility = 'NONE')") @NonNull @NonNull org.springframework.data.domain.Page<Room> findInaccessibleRoomsByFloor(int floor, @NonNull @NonNull org.springframework.data.domain.Pageable pageable) A subset – according to the givenPageable– of those Rooms in the database table that are located on the specified floor and haveAccessibility.NONEas theRoom.accessibility.- Parameters:
floor- The floor whose Rooms are looked for.pageable- The pagination information specifying which page of Rooms shall be returned.- Returns:
- The Rooms on the given floor, but only the specified subset.
-
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.
-
findRoomIdByNumber
-