Eager load guest for booking list
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-01-29 20:12:00 +05:30
parent 26b7392806
commit 5f5fd1f6b1

View File

@@ -2,12 +2,15 @@ package com.android.trisolarisserver.db.repo
import com.android.trisolarisserver.models.booking.Booking
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.EntityGraph
import java.util.UUID
interface BookingRepo : JpaRepository<Booking, UUID> {
fun findByPropertyIdAndSourceBookingId(propertyId: UUID, sourceBookingId: String): Booking?
fun existsByPropertyIdAndSourceBookingId(propertyId: UUID, sourceBookingId: String): Boolean
fun countByPrimaryGuestId(guestId: UUID): Long
@EntityGraph(attributePaths = ["primaryGuest"])
fun findByPropertyIdAndStatusInOrderByCreatedAtDesc(propertyId: UUID, status: Collection<com.android.trisolarisserver.models.booking.BookingStatus>): List<Booking>
@EntityGraph(attributePaths = ["primaryGuest"])
fun findByPropertyIdOrderByCreatedAtDesc(propertyId: UUID): List<Booking>
}