Eager-load rate plan room type to avoid lazy proxy errors
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user