@Repository public class DeviceDaoImpl extends Object implements DeviceDao
Constructor and Description |
---|
DeviceDaoImpl()
Creates new instance of the
DeviceDaoImpl . |
Modifier and Type | Method and Description |
---|---|
Long |
countDevices()
Counts the number of all registered devices.
|
Long |
countDevices(String deviceType)
Counts the number of devices by device type.
|
Long |
countDevicesWithoutUsername()
Returns a count of all devices that does not have a username
|
boolean |
doesDeviceHaveUsername(String deviceid)
Return tue if there is a username for the specifed deviceId
|
List<Device> |
findAllDevices()
Find all devices that are registered.
|
List<Device> |
findAllDevices(String deviceType)
Finds all devices of a specific type.
|
Device |
findDeviceByDeviceId(String deviceid)
Finds a device with the specified device ID
|
Device |
findDeviceById(Long id)
Finds a
Device by the Object ID for the Device |
Device |
findDeviceByRegId(String regid)
Finds devices with the specified device id.
|
List<Device> |
findDevicesByDeviceId(String deviceid)
Finds devices with the specified device id.
|
List<Device> |
findDevicesById(Long id)
This returns a list of devices with Long id.
|
List<Device> |
findDevicesByKeyword(String keyword)
Finds a List of
Device based on the specified keyword. |
List<Device> |
findDevicesByUsername(String username)
Returns a list of devices registed by a username.
|
List<Device> |
findDevicesWithoutUsername()
Finds all device that does not have a username
|
javax.persistence.EntityManager |
getEntityManager()
Returns the reference to the
EntityManager |
void |
registerDevice(Device device)
Persists a
Device instance |
boolean |
removeDevice(Device device)
Removes a
Device instance from persistence. |
void |
saveDevice(Device device)
Persists a
Device instance |
void |
setEntityManager(javax.persistence.EntityManager entityManager)
Sets the reference to the
EntityManager |
public DeviceDaoImpl()
DeviceDaoImpl
.public List<Device> findAllDevices()
DeviceDao
findAllDevices
in interface DeviceDao
public List<Device> findDevicesByUsername(String username)
DeviceDao
findDevicesByUsername
in interface DeviceDao
public boolean doesDeviceHaveUsername(String deviceid)
DeviceDao
doesDeviceHaveUsername
in interface DeviceDao
public List<Device> findDevicesWithoutUsername()
DeviceDao
findDevicesWithoutUsername
in interface DeviceDao
public List<Device> findDevicesById(Long id)
DeviceDao
findDevicesById
in interface DeviceDao
public Device findDeviceById(Long id)
DeviceDao
Device
by the Object ID for the Device
findDeviceById
in interface DeviceDao
id
- If of the Device
to find.public Device findDeviceByRegId(String regid)
DeviceDao
findDeviceByRegId
in interface DeviceDao
public List<Device> findDevicesByDeviceId(String deviceid)
DeviceDao
Device
findDevicesByDeviceId
in interface DeviceDao
public Device findDeviceByDeviceId(String deviceid)
DeviceDao
findDeviceByDeviceId
in interface DeviceDao
public List<Device> findDevicesByKeyword(String keyword)
DeviceDao
Device
based on the specified keyword.findDevicesByKeyword
in interface DeviceDao
@Transactional public boolean removeDevice(Device device)
DeviceDao
Device
instance from persistence.removeDevice
in interface DeviceDao
device
- The device to remove.public void saveDevice(Device device)
DeviceDao
Device
instancesaveDevice
in interface DeviceDao
public void registerDevice(Device device)
DeviceDao
Device
instanceregisterDevice
in interface DeviceDao
device
- The device to persistpublic Long countDevices()
DeviceDao
countDevices
in interface DeviceDao
public Long countDevicesWithoutUsername()
DeviceDao
countDevicesWithoutUsername
in interface DeviceDao
public Long countDevices(String deviceType)
DeviceDao
countDevices
in interface DeviceDao
public List<Device> findAllDevices(String deviceType)
DeviceDao
findAllDevices
in interface DeviceDao
public javax.persistence.EntityManager getEntityManager()
EntityManager
EntityManager
public void setEntityManager(javax.persistence.EntityManager entityManager)
EntityManager
entityManager
- The reference to the EntityManager
Copyright © 2011-2013 The Kuali Foundation. All Rights Reserved.