Added a class DeviceRepository that is needed to mirror in the database the class inheritances that are present among the various Devices. Also the method getDevices, that returns a List of the Devices present in a given room, has been added to RoomController.java
This commit is contained in:
parent
ce939cb7ea
commit
c853c4cd4e
1 changed files with 13 additions and 0 deletions
|
@ -0,0 +1,13 @@
|
||||||
|
package ch.usi.inf.sa4.sanmarinoes.smarthut.models;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
import org.springframework.data.repository.query.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DeviceRepository acts as a superclass for the other repositories so to mirror in the database the
|
||||||
|
* class inheritance present among the various devices.
|
||||||
|
*/
|
||||||
|
public interface DeviceRepository<T extends Device> extends CrudRepository<T, Long> {
|
||||||
|
List<T> findByRoomId(@Param("roomId") long roomId);
|
||||||
|
}
|
Loading…
Reference in a new issue