package com.android.trisolarisserver.repo import com.android.trisolarisserver.models.room.PropertyCardCounter import org.springframework.data.jpa.repository.JpaRepository import org.springframework.data.jpa.repository.Lock import org.springframework.data.jpa.repository.Query import org.springframework.data.repository.query.Param import java.util.UUID import jakarta.persistence.LockModeType interface PropertyCardCounterRepo : JpaRepository { fun findByPropertyId(propertyId: UUID): PropertyCardCounter? @Lock(LockModeType.PESSIMISTIC_WRITE) @Query("select c from PropertyCardCounter c where c.property.id = :propertyId") fun findByPropertyIdForUpdate(@Param("propertyId") propertyId: UUID): PropertyCardCounter? }