28 lines
1.1 KiB
Java
28 lines
1.1 KiB
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.Pendidikan;
|
|
|
|
@Repository("PendidikanDao")
|
|
public interface PendidikanDao extends PagingAndSortingRepository<Pendidikan, Integer> {
|
|
|
|
@Query("SELECT new map (model.id as id,model.namaPendidikan as namaPendidikan) "
|
|
+ "from Pendidikan model")
|
|
List<Map<String,Object>> findAllPendidikan();
|
|
|
|
@Query("select model from Pendidikan model where model.id=:id")
|
|
Pendidikan findByIdPendidikan(@Param("id") Integer id);
|
|
|
|
@Query("select new Map(model.id as id, model.namaPendidikan as namaPendidikan, model.jenisPendidikanId as jenisPendidikanId) "
|
|
+ "from Pendidikan model where model.id = :pendidikanId and model.statusEnabled is true")
|
|
public Map<String, Object> getPendidikanById(@Param("pendidikanId") Integer pendidikanId);
|
|
|
|
}
|