added auth,property db and room db,org db
This commit is contained in:
@@ -2,6 +2,7 @@ package com.android.trisolarisserver.db.repo
|
||||
|
||||
|
||||
import com.android.trisolarisserver.models.room.Room
|
||||
import org.springframework.data.jpa.repository.EntityGraph
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import org.springframework.data.jpa.repository.Query
|
||||
import org.springframework.data.repository.query.Param
|
||||
@@ -9,6 +10,17 @@ import java.util.UUID
|
||||
|
||||
interface RoomRepo : JpaRepository<Room, UUID> {
|
||||
|
||||
@EntityGraph(attributePaths = ["roomType"])
|
||||
fun findByPropertyIdOrderByRoomNumber(propertyId: UUID): List<Room>
|
||||
|
||||
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): Room?
|
||||
|
||||
fun existsByPropertyIdAndRoomNumber(propertyId: UUID, roomNumber: Int): Boolean
|
||||
|
||||
fun existsByPropertyIdAndRoomNumberAndIdNot(propertyId: UUID, roomNumber: Int, id: UUID): Boolean
|
||||
|
||||
fun existsByPropertyIdAndRoomTypeId(propertyId: UUID, roomTypeId: UUID): Boolean
|
||||
|
||||
@Query("""
|
||||
select r
|
||||
from Room r
|
||||
|
||||
Reference in New Issue
Block a user