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.PeriodePengajar;

/**
 * Repository class for PeriodePengajar
 * 
 * @author Generator
 */
@Repository("PeriodePengajarDao")
public interface PeriodePengajarDao extends PagingAndSortingRepository<PeriodePengajar, String> {
	@Query("select model from PeriodePengajar model where model.name =:name")
	PeriodePengajar findByName(@Param("name") String name);
	
	@Query("select new Map(model.id as id, model.name as name) from PeriodePengajar model where model.id = :periodePengajarId and model.statusEnabled is true")
	public Map<String, Object> getPeriodePengajarById(@Param("periodePengajarId") Integer periodePengajarId);
}
