Eager-load rate plan room type to avoid lazy proxy errors
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s

This commit is contained in:
androidlover5842
2026-01-29 05:29:10 +05:30
parent 5c6b14331d
commit ac9df5f4bd
2 changed files with 2 additions and 1 deletions

View File

@@ -5,7 +5,6 @@ import com.android.trisolarisserver.models.property.AppUser
import jakarta.persistence.*
import java.time.OffsetDateTime
import java.util.UUID
//TODO:store signature image of guest
@Entity
@Table(
name = "guest",

View File

@@ -2,9 +2,11 @@ package com.android.trisolarisserver.repo
import com.android.trisolarisserver.models.room.RatePlan
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.EntityGraph
import java.util.UUID
interface RatePlanRepo : JpaRepository<RatePlan, UUID> {
@EntityGraph(attributePaths = ["roomType"])
fun findByPropertyIdOrderByCode(propertyId: UUID): List<RatePlan>
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): RatePlan?
fun existsByPropertyIdAndCode(propertyId: UUID, code: String): Boolean