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 jakarta.persistence.*
|
||||||
import java.time.OffsetDateTime
|
import java.time.OffsetDateTime
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
//TODO:store signature image of guest
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(
|
@Table(
|
||||||
name = "guest",
|
name = "guest",
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ package com.android.trisolarisserver.repo
|
|||||||
|
|
||||||
import com.android.trisolarisserver.models.room.RatePlan
|
import com.android.trisolarisserver.models.room.RatePlan
|
||||||
import org.springframework.data.jpa.repository.JpaRepository
|
import org.springframework.data.jpa.repository.JpaRepository
|
||||||
|
import org.springframework.data.jpa.repository.EntityGraph
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
|
|
||||||
interface RatePlanRepo : JpaRepository<RatePlan, UUID> {
|
interface RatePlanRepo : JpaRepository<RatePlan, UUID> {
|
||||||
|
@EntityGraph(attributePaths = ["roomType"])
|
||||||
fun findByPropertyIdOrderByCode(propertyId: UUID): List<RatePlan>
|
fun findByPropertyIdOrderByCode(propertyId: UUID): List<RatePlan>
|
||||||
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): RatePlan?
|
fun findByIdAndPropertyId(id: UUID, propertyId: UUID): RatePlan?
|
||||||
fun existsByPropertyIdAndCode(propertyId: UUID, code: String): Boolean
|
fun existsByPropertyIdAndCode(propertyId: UUID, code: String): Boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user