All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tairitsu.ignotus.database.TransactionAspect.kt Maven / Gradle / Ivy

The newest version!
package com.tairitsu.ignotus.database

import org.aspectj.lang.ProceedingJoinPoint
import org.aspectj.lang.annotation.Around
import org.aspectj.lang.annotation.Aspect
import org.jetbrains.exposed.sql.transactions.transaction
import org.springframework.stereotype.Component

@Aspect
@Component
open class TransactionAspect {
    @Around("@annotation(com.tairitsu.ignotus.database.annotation.Transaction)")
    fun transactionHandler(joinPoint: ProceedingJoinPoint): Any? {
        var result: Any? = null
        transaction {
            result = joinPoint.proceed()
        }
        return result
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy