sensoritem paging sorting
This commit is contained in:
parent
55d1b7ec4f
commit
52f553a9b9
|
@ -2,16 +2,15 @@ package com.loafle.overflow.module.sensor.dao;
|
|||
|
||||
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by root on 17. 6. 9.
|
||||
*/
|
||||
@Repository
|
||||
public interface SensorItemDAO extends JpaRepository<SensorItem, Long> {
|
||||
List<SensorItem> findAllBySensor(Sensor sensor, Pageable pageable);
|
||||
Page<SensorItem> findAllBySensor(Sensor sensor, Pageable pageable);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.loafle.overflow.module.sensor.dao.SensorItemDAO;
|
|||
import com.loafle.overflow.module.sensor.model.Sensor;
|
||||
import com.loafle.overflow.module.sensor.model.SensorItem;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -31,7 +32,7 @@ public class SensorItemService {
|
|||
return this.sensorItemDAO.findOne(Long.valueOf(id));
|
||||
}
|
||||
|
||||
public List<SensorItem> readAllBySensor(Sensor sensor, PageParams pageParams) {
|
||||
public Page<SensorItem> readAllBySensor(Sensor sensor, PageParams pageParams) {
|
||||
return this.sensorItemDAO.findAllBySensor(sensor, PageUtil.getPageRequest(pageParams));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user