|
|
|
@ -22,6 +22,7 @@ import org.springframework.data.domain.Page; |
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
import org.springframework.data.repository.CrudRepository; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
import org.thingsboard.server.common.data.Device; |
|
|
|
import org.thingsboard.server.common.data.DeviceInfo; |
|
|
|
@ -71,6 +72,14 @@ public class JpaDeviceDao extends JpaAbstractSearchTextDao<DeviceEntity, Device> |
|
|
|
return DaoUtil.getData(deviceRepository.findDeviceInfoById(deviceId)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public Device saveAndFlush(TenantId tenantId, Device device) { |
|
|
|
Device result = this.save(tenantId, device); |
|
|
|
deviceRepository.flush(); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<Device> findDevicesByTenantId(UUID tenantId, PageLink pageLink) { |
|
|
|
if (StringUtils.isEmpty(pageLink.getTextSearch())) { |
|
|
|
|