package com.jasamedika.medifirst2000.dao; import java.util.Map; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import com.jasamedika.medifirst2000.entities.Agama; @Repository("AgamaDao") public interface AgamaDao extends PagingAndSortingRepository { @Query("select model from Agama model where model.id=:id") Agama findByIdAgama(@Param("id") Integer id); @Query("select new Map(agama.id as id, agama.agama as agama) from Agama agama where agama.id = :agamaId and agama.statusEnabled is true") Map getAgamaById(@Param("agamaId") Integer agamaId); }