package gaf3.core.services.log.dao

import gaf3.core.services.log.entity.GafLog
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.JpaSpecificationExecutor
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param

interface GafLogDAO : JpaRepository<GafLog, String>, JpaSpecificationExecutor<GafLog> {

    @Query(value = "select distinct p.module from GafLog p")
    fun fetchModules(): List<String>

    @Query(value = "select distinct p.event from GafLog p")
    fun fetchEvents(): List<String>

    @Query(value = "select distinct p.action from GafLog p")
    fun fetchActions(): List<String>

    @Query(value = "select distinct p.result from GafLog p")
    fun fetchResults(): List<String>
}
