29 lines
970 B
Java
29 lines
970 B
Java
package com.jasamedika.medifirst2000.dao;
|
|
|
|
import java.util.List;
|
|
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.Golongan;
|
|
|
|
/**
|
|
* Repository class for Golongan
|
|
*
|
|
* @author Generator
|
|
*/
|
|
@Repository("GolonganDao")
|
|
public interface GolonganDao extends PagingAndSortingRepository<Golongan, Integer> {
|
|
|
|
@Query("select new map (model.id as id, model.name as name) from Golongan model where model.statusEnabled is true")
|
|
public List<Map<String, Object>> getAllByStatusEnabled();
|
|
|
|
@Query("select new Map(model.id as id, model.name as name) from Golongan model where model.id = :GolonganId and model.statusEnabled is true")
|
|
public Map<String, Object> getGolonganById(@Param("GolonganId") Integer GolonganId);
|
|
|
|
|
|
}
|