Removed provision info from device dao

This commit is contained in:
zbeacon 2020-09-28 15:48:23 +03:00
parent 70b8647ef4
commit 263dd8f9b3
3 changed files with 0 additions and 17 deletions

View File

@ -214,7 +214,4 @@ public interface DeviceDao extends Dao<Device> {
* @return the list of device objects * @return the list of device objects
*/ */
PageData<Device> findDevicesByTenantIdAndProfileId(UUID tenantId, UUID profileId, PageLink pageLink); PageData<Device> findDevicesByTenantIdAndProfileId(UUID tenantId, UUID profileId, PageLink pageLink);
Optional<Device> findDeviceByProfileNameAndDeviceDataProvisionConfigurationPair(String profileName, String provisionDeviceKey, String provisionDeviceSecret);
} }

View File

@ -168,13 +168,4 @@ public interface DeviceRepository extends PagingAndSortingRepository<DeviceEntit
DeviceEntity findByTenantIdAndId(UUID tenantId, UUID id); DeviceEntity findByTenantIdAndId(UUID tenantId, UUID id);
Long countByDeviceProfileId(UUID deviceProfileId); Long countByDeviceProfileId(UUID deviceProfileId);
@Query(value = "SELECT * FROM Device as d " +
"WHERE d.device_data->'configuration'->>'provisionDeviceKey' = :provisionDeviceKey " +
"AND d.device_data->'configuration'->>'provisionDeviceSecret' = :provisionDeviceSecret " +
"AND d.type = :profileName",
nativeQuery = true)
DeviceEntity findDeviceByProfileNameAndDeviceDataProvisionConfigurationPair(@Param("profileName") String profileName,
@Param("provisionDeviceKey") String provisionDeviceKey,
@Param("provisionDeviceSecret") String provisionDeviceSecret);
} }

View File

@ -219,11 +219,6 @@ public class JpaDeviceDao extends JpaAbstractSearchTextDao<DeviceEntity, Device>
return deviceRepository.countByDeviceProfileId(deviceProfileId); return deviceRepository.countByDeviceProfileId(deviceProfileId);
} }
@Override
public Optional<Device> findDeviceByProfileNameAndDeviceDataProvisionConfigurationPair(String profileName, String provisionDeviceKey, String provisionDeviceSecret) {
return Optional.ofNullable(DaoUtil.getData(deviceRepository.findDeviceByProfileNameAndDeviceDataProvisionConfigurationPair(profileName, provisionDeviceKey, provisionDeviceSecret)));
}
private List<EntitySubtype> convertTenantDeviceTypesToDto(UUID tenantId, List<String> types) { private List<EntitySubtype> convertTenantDeviceTypesToDto(UUID tenantId, List<String> types) {
List<EntitySubtype> list = Collections.emptyList(); List<EntitySubtype> list = Collections.emptyList();
if (types != null && !types.isEmpty()) { if (types != null && !types.isEmpty()) {