move card issuence server side
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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<PropertyCardCounter, UUID> {
|
||||
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?
|
||||
}
|
||||
Reference in New Issue
Block a user