Sensor modify
This commit is contained in:
parent
6a3cb4af63
commit
ed72bf084b
|
@ -58,4 +58,8 @@ public class CentralSensorItemService implements SensorItemService {
|
|||
this.sensorItemDAO.deleteById(sensorItemID);
|
||||
}
|
||||
|
||||
public void removeAllBySensorID(Long sensorID) throws OverflowException {
|
||||
this.sensorItemDAO.deleteAll(this.readAllBySensorID(sensorID));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,8 +57,15 @@ public class CentralSensorService implements SensorService {
|
|||
@Transactional
|
||||
@Override
|
||||
public Sensor modify(Long sensorID, List<MetaDisplayItemMapping> metaDisplayItemMappings) throws OverflowException {
|
||||
// FIXME : not impl
|
||||
return null;
|
||||
Sensor sensor = this.read(sensorID);
|
||||
if (null == sensor) {
|
||||
throw new OverflowException(String.format("ID[%d] of Sensor is not valid", sensorID));
|
||||
}
|
||||
this.sensorItemService.readAllBySensorID(sensorID);
|
||||
for (MetaDisplayItemMapping metaDisplayItemMapping : metaDisplayItemMappings) {
|
||||
this.sensorItemService.regist(sensor, metaDisplayItemMapping);
|
||||
}
|
||||
return sensor;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user