36 changed files with 590 additions and 183 deletions
@ -0,0 +1,19 @@ |
|||
package org.thingsboard.server.dao.sql.device; |
|||
|
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|||
import org.springframework.data.repository.CrudRepository; |
|||
import org.springframework.stereotype.Component; |
|||
import org.thingsboard.server.dao.model.sql.DeviceCredentialsEntity; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
@ConditionalOnProperty(prefix = "sql", value = "enabled", havingValue = "true", matchIfMissing = false) |
|||
public interface DeviceCredentialsRepository extends CrudRepository<DeviceCredentialsEntity, UUID> { |
|||
|
|||
DeviceCredentialsEntity findByDeviceId(UUID deviceId); |
|||
|
|||
DeviceCredentialsEntity findByCredentialsId(String credentialsId); |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package org.thingsboard.server.dao.sql.device; |
|||
|
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|||
import org.springframework.data.jpa.repository.Query; |
|||
import org.springframework.data.repository.CrudRepository; |
|||
import org.springframework.scheduling.annotation.Async; |
|||
import org.springframework.util.concurrent.ListenableFuture; |
|||
import org.thingsboard.server.dao.model.sql.DeviceEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
@ConditionalOnProperty(prefix = "sql", value = "enabled", havingValue = "true", matchIfMissing = false) |
|||
public interface DeviceRepository extends CrudRepository<DeviceEntity, UUID> { |
|||
|
|||
@Query(nativeQuery = true, value = "SELECT * FROM DEVICE WHERE TENANT_ID = ?2 " + |
|||
"AND CUSTOMER_ID = ?3 " + |
|||
"AND LOWER(SEARCH_TEXT) LIKE LOWER(CONCAT(?4, '%')) " + |
|||
"ORDER BY ID LIMIT ?1") |
|||
List<DeviceEntity> findByTenantIdAndCustomerIdFirstPage(int limit, UUID tenantId, UUID customerId, String searchText); |
|||
|
|||
@Query(nativeQuery = true, value = "SELECT * FROM DEVICE WHERE TENANT_ID = ?2 " + |
|||
"AND CUSTOMER_ID = ?3 " + |
|||
"AND LOWER(SEARCH_TEXT) LIKE LOWER(CONCAT(?4, '%')) " + |
|||
"AND ID > ?5 ORDER BY ID LIMIT ?1") |
|||
List<DeviceEntity> findByTenantIdAndCustomerIdNextPage(int limit, UUID tenantId, UUID customerId, String searchText, UUID idOffset); |
|||
|
|||
@Query(nativeQuery = true, value = "SELECT * FROM DEVICE WHERE TENANT_ID = ?2 " + |
|||
"AND LOWER(SEARCH_TEXT) LIKE LOWER(CONCAT(?3, '%')) " + |
|||
"ORDER BY ID LIMIT ?1") |
|||
List<DeviceEntity> findByTenantIdFirstPage(int limit, UUID tenantId, String textSearch); |
|||
|
|||
@Query(nativeQuery = true, value = "SELECT * FROM DEVICE WHERE TENANT_ID = ?2 " + |
|||
"AND LOWER(SEARCH_TEXT) LIKE LOWER(CONCAT(?3, '%')) " + |
|||
"AND ID > ?4 ORDER BY ID LIMIT ?1") |
|||
List<DeviceEntity> findByTenantIdNextPage(int limit, UUID tenantId, String textSearch, UUID idOffset); |
|||
|
|||
DeviceEntity findByTenantIdAndName(UUID tenantId, String name); |
|||
|
|||
List<DeviceEntity> findDevicesByTenantIdAndCustomerIdAndIdIn(UUID tenantId, UUID customerId, List<UUID> deviceIds); |
|||
|
|||
List<DeviceEntity> findDevicesByTenantId(UUID tenantId); |
|||
List<DeviceEntity> findDevicesByTenantIdAndIdIn(UUID tenantId, List<UUID> deviceIds); |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package org.thingsboard.server.dao.sql.device; |
|||
|
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|||
import org.springframework.data.repository.CrudRepository; |
|||
import org.springframework.stereotype.Component; |
|||
import org.thingsboard.server.common.data.security.DeviceCredentials; |
|||
import org.thingsboard.server.dao.DaoUtil; |
|||
import org.thingsboard.server.dao.device.DeviceCredentialsDao; |
|||
import org.thingsboard.server.dao.model.ModelConstants; |
|||
import org.thingsboard.server.dao.model.sql.DeviceCredentialsEntity; |
|||
import org.thingsboard.server.dao.sql.JpaAbstractDao; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
@Component |
|||
@ConditionalOnProperty(prefix = "sql", value = "enabled", havingValue = "true", matchIfMissing = false) |
|||
public class JpaDeviceCredentialsDao extends JpaAbstractDao<DeviceCredentialsEntity, DeviceCredentials> implements DeviceCredentialsDao { |
|||
|
|||
@Autowired |
|||
private DeviceCredentialsRepository deviceCredentialsRepository; |
|||
|
|||
@Override |
|||
protected Class<DeviceCredentialsEntity> getEntityClass() { |
|||
return DeviceCredentialsEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
protected String getColumnFamilyName() { |
|||
{ |
|||
return ModelConstants.DEVICE_CREDENTIALS_COLUMN_FAMILY_NAME; |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
protected CrudRepository<DeviceCredentialsEntity, UUID> getCrudRepository() { |
|||
return deviceCredentialsRepository; |
|||
} |
|||
|
|||
@Override |
|||
public DeviceCredentials findByDeviceId(UUID deviceId) { |
|||
return DaoUtil.getData(deviceCredentialsRepository.findByDeviceId(deviceId)); |
|||
} |
|||
|
|||
@Override |
|||
public DeviceCredentials findByCredentialsId(String credentialsId) { |
|||
return DaoUtil.getData(deviceCredentialsRepository.findByCredentialsId(credentialsId)); |
|||
} |
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
package org.thingsboard.server.dao.sql.device; |
|||
|
|||
import com.google.common.util.concurrent.ListenableFuture; |
|||
import com.google.common.util.concurrent.ListeningExecutorService; |
|||
import com.google.common.util.concurrent.MoreExecutors; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
|||
import org.springframework.data.repository.CrudRepository; |
|||
import org.springframework.stereotype.Component; |
|||
import org.thingsboard.server.common.data.Device; |
|||
import org.thingsboard.server.common.data.page.TextPageLink; |
|||
import org.thingsboard.server.dao.DaoUtil; |
|||
import org.thingsboard.server.dao.device.DeviceDao; |
|||
import org.thingsboard.server.dao.model.sql.DeviceEntity; |
|||
import org.thingsboard.server.dao.sql.JpaAbstractSearchTextDao; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import java.util.UUID; |
|||
import java.util.concurrent.Executors; |
|||
|
|||
import static org.thingsboard.server.dao.model.ModelConstants.DEVICE_COLUMN_FAMILY_NAME; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
@Component |
|||
@ConditionalOnProperty(prefix = "sql", value = "enabled", havingValue = "true", matchIfMissing = false) |
|||
public class JpaDeviceDao extends JpaAbstractSearchTextDao<DeviceEntity, Device> implements DeviceDao { |
|||
|
|||
@Autowired |
|||
DeviceRepository deviceRepository; |
|||
|
|||
@Override |
|||
protected Class<DeviceEntity> getEntityClass() { |
|||
return DeviceEntity.class; |
|||
} |
|||
|
|||
@Override |
|||
protected String getColumnFamilyName() { |
|||
return DEVICE_COLUMN_FAMILY_NAME; |
|||
} |
|||
|
|||
@Override |
|||
protected CrudRepository<DeviceEntity, UUID> getCrudRepository() { |
|||
return deviceRepository; |
|||
} |
|||
|
|||
@Override |
|||
public List<Device> findDevicesByTenantId(UUID tenantId, TextPageLink pageLink) { |
|||
if (pageLink.getIdOffset() == null) { |
|||
return DaoUtil.convertDataList(deviceRepository.findByTenantIdFirstPage( |
|||
pageLink.getLimit(), tenantId, pageLink.getTextSearch())); |
|||
} else { |
|||
return DaoUtil.convertDataList(deviceRepository.findByTenantIdNextPage( |
|||
pageLink.getLimit(), tenantId, pageLink.getTextSearch(), pageLink.getIdOffset())); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public ListenableFuture<List<Device>> findDevicesByTenantIdAndIdsAsync(UUID tenantId, List<UUID> deviceIds) { |
|||
System.out.println(deviceRepository.findDevicesByTenantIdAndIdIn(tenantId, deviceIds).size()); |
|||
ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10)); |
|||
return service.submit(() -> DaoUtil.convertDataList(deviceRepository.findDevicesByTenantIdAndIdIn(tenantId, deviceIds))); |
|||
} |
|||
|
|||
@Override |
|||
public List<Device> findDevicesByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TextPageLink pageLink) { |
|||
if (pageLink.getIdOffset() == null) { |
|||
return DaoUtil.convertDataList(deviceRepository.findByTenantIdAndCustomerIdFirstPage(pageLink.getLimit(), |
|||
tenantId, customerId, pageLink.getTextSearch())); |
|||
} else { |
|||
return DaoUtil.convertDataList(deviceRepository.findByTenantIdAndCustomerIdNextPage(pageLink.getLimit(), |
|||
tenantId, customerId, pageLink.getTextSearch(), pageLink.getIdOffset())); |
|||
} |
|||
} |
|||
|
|||
@Override |
|||
public ListenableFuture<List<Device>> findDevicesByTenantIdCustomerIdAndIdsAsync(UUID tenantId, UUID customerId, List<UUID> deviceIds) { |
|||
ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10)); |
|||
return service.submit(() -> DaoUtil.convertDataList( |
|||
deviceRepository.findDevicesByTenantIdAndCustomerIdAndIdIn(tenantId, customerId, deviceIds))); |
|||
} |
|||
|
|||
@Override |
|||
// Probably findDevice, not findDevices?
|
|||
public Optional<Device> findDevicesByTenantIdAndName(UUID tenantId, String name) { |
|||
Device device = DaoUtil.getData(deviceRepository.findByTenantIdAndName(tenantId, name)); |
|||
return Optional.ofNullable(device); |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
package org.thingsboard.server.dao; |
|||
|
|||
import com.github.springtestdbunit.bean.DatabaseConfigBean; |
|||
import com.github.springtestdbunit.bean.DatabaseDataSourceConnectionFactoryBean; |
|||
import org.dbunit.DatabaseUnitException; |
|||
import org.dbunit.ext.postgresql.PostgresqlDataTypeFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
import javax.sql.DataSource; |
|||
import java.io.IOException; |
|||
import java.sql.SQLException; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
@Configuration |
|||
public class JpaDbunitTestConfig { |
|||
|
|||
@Autowired |
|||
private DataSource dataSource; |
|||
|
|||
@Bean |
|||
public DatabaseConfigBean databaseConfigBean() { |
|||
DatabaseConfigBean databaseConfigBean = new DatabaseConfigBean(); |
|||
databaseConfigBean.setDatatypeFactory(new PostgresqlDataTypeFactory()); |
|||
return databaseConfigBean; |
|||
} |
|||
|
|||
@Bean(name = "dbUnitDatabaseConnection") |
|||
public DatabaseDataSourceConnectionFactoryBean dbUnitDatabaseConnection() throws SQLException, DatabaseUnitException, IOException { |
|||
DatabaseDataSourceConnectionFactoryBean databaseDataSourceConnectionFactoryBean = new DatabaseDataSourceConnectionFactoryBean(); |
|||
databaseDataSourceConnectionFactoryBean.setDatabaseConfig(databaseConfigBean()); |
|||
databaseDataSourceConnectionFactoryBean.setDataSource(dataSource); |
|||
databaseDataSourceConnectionFactoryBean.setSchema("public"); |
|||
return databaseDataSourceConnectionFactoryBean; |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package org.thingsboard.server.dao.sql.device; |
|||
|
|||
import com.github.springtestdbunit.annotation.DatabaseSetup; |
|||
import org.junit.Test; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.thingsboard.server.common.data.security.DeviceCredentials; |
|||
import org.thingsboard.server.dao.AbstractJpaDaoTest; |
|||
import org.thingsboard.server.dao.device.DeviceCredentialsDao; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
import static org.junit.Assert.assertEquals; |
|||
import static org.junit.Assert.assertNotNull; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
public class JpaDeviceCredentialsDaoTest extends AbstractJpaDaoTest { |
|||
|
|||
@Autowired |
|||
DeviceCredentialsDao deviceCredentialsDao; |
|||
|
|||
@Test |
|||
@DatabaseSetup("classpath:dbunit/device_credentials.xml") |
|||
public void testFindByDeviceId() { |
|||
UUID deviceId = UUID.fromString("958e3a30-3215-11e7-93ae-92361f002671"); |
|||
DeviceCredentials deviceCredentials = deviceCredentialsDao.findByDeviceId(deviceId); |
|||
assertNotNull(deviceCredentials); |
|||
assertEquals("958e3314-3215-11e7-93ae-92361f002671", deviceCredentials.getId().getId().toString()); |
|||
assertEquals("ID_1", deviceCredentials.getCredentialsId()); |
|||
} |
|||
|
|||
@Test |
|||
@DatabaseSetup("classpath:dbunit/device_credentials.xml") |
|||
public void findByCredentialsId() { |
|||
String credentialsId = "ID_2"; |
|||
DeviceCredentials deviceCredentials = deviceCredentialsDao.findByCredentialsId(credentialsId); |
|||
assertNotNull(deviceCredentials); |
|||
assertEquals("958e3c74-3215-11e7-93ae-92361f002671", deviceCredentials.getId().getId().toString()); |
|||
} |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
package org.thingsboard.server.dao.sql.device; |
|||
|
|||
import com.datastax.driver.core.utils.UUIDs; |
|||
import com.github.springtestdbunit.annotation.DatabaseOperation; |
|||
import com.github.springtestdbunit.annotation.DatabaseSetup; |
|||
import com.github.springtestdbunit.annotation.DatabaseTearDown; |
|||
import com.google.common.util.concurrent.*; |
|||
import org.junit.Test; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.thingsboard.server.common.data.Device; |
|||
import org.thingsboard.server.common.data.id.CustomerId; |
|||
import org.thingsboard.server.common.data.id.DeviceId; |
|||
import org.thingsboard.server.common.data.id.TenantId; |
|||
import org.thingsboard.server.common.data.page.TextPageLink; |
|||
import org.thingsboard.server.dao.AbstractJpaDaoTest; |
|||
import org.thingsboard.server.dao.device.DeviceDao; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Arrays; |
|||
import java.util.List; |
|||
import java.util.UUID; |
|||
import java.util.concurrent.ExecutionException; |
|||
import java.util.concurrent.Executors; |
|||
|
|||
import static org.junit.Assert.assertEquals; |
|||
import static org.junit.Assert.assertNotNull; |
|||
|
|||
/** |
|||
* Created by Valerii Sosliuk on 5/6/2017. |
|||
*/ |
|||
@Transactional |
|||
public class JpaDeviceDaoTest extends AbstractJpaDaoTest { |
|||
|
|||
@Autowired |
|||
private DeviceDao deviceDao; |
|||
|
|||
@Test |
|||
@DatabaseSetup(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
@DatabaseTearDown(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
public void testFindDevicesByTenantId() { |
|||
UUID tenantId1 = UUIDs.timeBased(); |
|||
UUID tenantId2 = UUIDs.timeBased(); |
|||
UUID customerId1 = UUIDs.timeBased(); |
|||
UUID customerId2 = UUIDs.timeBased(); |
|||
createDevices(tenantId1, tenantId2, customerId1, customerId2, 40); |
|||
|
|||
TextPageLink pageLink1 = new TextPageLink(15, "SEARCH_TEXT"); |
|||
List<Device> devices1 = deviceDao.findDevicesByTenantId(tenantId1, pageLink1); |
|||
assertEquals(15, devices1.size()); |
|||
|
|||
TextPageLink pageLink2 = new TextPageLink(15, "SEARCH_TEXT", devices1.get(14).getId().getId(), null); |
|||
List<Device> devices2 = deviceDao.findDevicesByTenantId(tenantId1, pageLink2); |
|||
assertEquals(5, devices2.size()); |
|||
} |
|||
|
|||
@Test |
|||
@DatabaseSetup(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
@DatabaseTearDown(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
public void testFindAsync() throws ExecutionException, InterruptedException { |
|||
UUID tenantId = UUIDs.timeBased(); |
|||
UUID customerId = UUIDs.timeBased(); |
|||
Device device = getDevice(tenantId, customerId); |
|||
deviceDao.save(device); |
|||
|
|||
UUID uuid = device.getId().getId(); |
|||
Device entity = deviceDao.findById(uuid); |
|||
assertNotNull(entity); |
|||
assertEquals(uuid, entity.getId().getId()); |
|||
|
|||
ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10)); |
|||
ListenableFuture<Device> future = service.submit(() -> deviceDao.findById(uuid)); |
|||
Device asyncDevice = future.get(); |
|||
assertNotNull("Async device expected to be not null", asyncDevice); |
|||
} |
|||
|
|||
@Test |
|||
@DatabaseSetup(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
@DatabaseTearDown(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
public void testFindDevicesByTenantIdAndIdsAsync() throws ExecutionException, InterruptedException { |
|||
UUID tenantId1 = UUIDs.timeBased(); |
|||
UUID customerId1 = UUIDs.timeBased(); |
|||
UUID tenantId2 = UUIDs.timeBased(); |
|||
UUID customerId2 = UUIDs.timeBased(); |
|||
|
|||
List<UUID> deviceIds = new ArrayList<>(); |
|||
|
|||
for(int i = 0; i < 5; i++) { |
|||
UUID deviceId1 = UUIDs.timeBased(); |
|||
UUID deviceId2 = UUIDs.timeBased(); |
|||
deviceDao.save(getDevice(tenantId1, customerId1, deviceId1)); |
|||
deviceDao.save(getDevice(tenantId2, customerId2, deviceId2)); |
|||
deviceIds.add(deviceId1); |
|||
deviceIds.add(deviceId2); |
|||
} |
|||
|
|||
ListenableFuture<List<Device>> devicesFuture = deviceDao.findDevicesByTenantIdAndIdsAsync(tenantId1, deviceIds); |
|||
List<Device> devices = devicesFuture.get(); |
|||
assertEquals(5, devices.size()); |
|||
} |
|||
|
|||
@Test |
|||
@DatabaseSetup(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
@DatabaseTearDown(value = "classpath:dbunit/empty_dataset.xml",type = DatabaseOperation.DELETE_ALL) |
|||
public void testFindDevicesByTenantIdAndCustomerIdAndIdsAsync() throws ExecutionException, InterruptedException { |
|||
UUID tenantId1 = UUIDs.timeBased(); |
|||
UUID customerId1 = UUIDs.timeBased(); |
|||
UUID tenantId2 = UUIDs.timeBased(); |
|||
UUID customerId2 = UUIDs.timeBased(); |
|||
|
|||
List<UUID> deviceIds = new ArrayList<>(); |
|||
|
|||
for(int i = 0; i < 20; i++) { |
|||
UUID deviceId1 = UUIDs.timeBased(); |
|||
UUID deviceId2 = UUIDs.timeBased(); |
|||
deviceDao.save(getDevice(tenantId1, customerId1, deviceId1)); |
|||
deviceDao.save(getDevice(tenantId2, customerId2, deviceId2)); |
|||
deviceIds.add(deviceId1); |
|||
deviceIds.add(deviceId2); |
|||
} |
|||
|
|||
ListenableFuture<List<Device>> devicesFuture = deviceDao.findDevicesByTenantIdCustomerIdAndIdsAsync(tenantId1, customerId1, deviceIds); |
|||
List<Device> devices = devicesFuture.get(); |
|||
assertEquals(20, devices.size()); |
|||
} |
|||
|
|||
private void createDevices(UUID tenantId1, UUID tenantId2, UUID customerId1, UUID customerId2, int count) { |
|||
for (int i = 0; i < count / 2; i++) { |
|||
deviceDao.save(getDevice(tenantId1, customerId1)); |
|||
deviceDao.save(getDevice(tenantId2, customerId2)); |
|||
} |
|||
} |
|||
|
|||
private Device getDevice(UUID tenantId, UUID customerID) { |
|||
return getDevice(tenantId, customerID, UUIDs.timeBased()); |
|||
} |
|||
|
|||
private Device getDevice(UUID tenantId, UUID customerID, UUID deviceId) { |
|||
Device device = new Device(); |
|||
device.setId(new DeviceId(deviceId)); |
|||
device.setTenantId(new TenantId(tenantId)); |
|||
device.setCustomerId(new CustomerId(customerID)); |
|||
device.setName("SEARCH_TEXT"); |
|||
return device; |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
<dataset> |
|||
<device_credentials |
|||
id="958e3314-3215-11e7-93ae-92361f002671" |
|||
device_id="958e3a30-3215-11e7-93ae-92361f002671" |
|||
credentials_type="0" |
|||
credentials_id="ID_1" |
|||
credentials_value="ACCESS_TOKEN_1" |
|||
/> |
|||
<device_credentials |
|||
id="958e3c74-3215-11e7-93ae-92361f002671" |
|||
device_id="958e3e5e-3215-11e7-93ae-92361f002671" |
|||
credentials_type="0" |
|||
credentials_id="ID_2" |
|||
credentials_value="ACCESS_TOKEN_2" |
|||
/> |
|||
</dataset> |
|||
@ -1,56 +1,47 @@ |
|||
<dataset> |
|||
<widgets_bundle |
|||
id="uuid'250ac7b4-2825-11e7-93ae-92361f002671'" |
|||
tenant_id="uuid'250aca8e-2825-11e7-93ae-92361f002671'" |
|||
id="250ac7b4-2825-11e7-93ae-92361f002671" |
|||
tenant_id="250aca8e-2825-11e7-93ae-92361f002671" |
|||
alias="WB1" |
|||
title="Widgets Bundle 1" |
|||
search_text="WB SEARCH TEXT 1" |
|||
/> |
|||
<widgets_bundle |
|||
id="uuid'3269c18a-2825-11e7-93ae-92361f002671'" |
|||
tenant_id="uuid'3269c18a-2825-11e7-93ae-92361f002671'" |
|||
id="3269c18a-2825-11e7-93ae-92361f002671" |
|||
tenant_id="3269c18a-2825-11e7-93ae-92361f002671" |
|||
alias="WB2" |
|||
title="Widgets Bundle 2" |
|||
search_text="WB SEARCH TEXT 2" |
|||
/> |
|||
<widgets_bundle |
|||
id="uuid'44e6af4e-2825-11e7-93ae-92361f002671'" |
|||
tenant_id="uuid'250aca8e-2825-11e7-93ae-92361f002671'" |
|||
id="44e6af4e-2825-11e7-93ae-92361f002671" |
|||
tenant_id="250aca8e-2825-11e7-93ae-92361f002671" |
|||
alias="WB3" |
|||
title="Widgets Bundle 3" |
|||
search_text="WB SEARCH TEXT 3" |
|||
/> |
|||
<widgets_bundle |
|||
id="uuid'696dc9b4-2830-11e7-93ae-92361f002671'" |
|||
id="696dc9b4-2830-11e7-93ae-92361f002671" |
|||
alias="WB4" |
|||
title="Widgets Bundle 4" |
|||
search_text="SYSTEM BUNDLE 1" |
|||
/> |
|||
<widgets_bundle |
|||
id="uuid'1a83fc50-2840-11e7-93ae-92361f002671'" |
|||
id="1a83fc50-2840-11e7-93ae-92361f002671" |
|||
alias="WB5" |
|||
title="Widgets Bundle 5" |
|||
search_text="SYSTEM BUNDLE 2" |
|||
/> |
|||
<widgets_bundle |
|||
id="uuid'6a593dde-2841-11e7-93ae-92361f002671'" |
|||
id="6a593dde-2841-11e7-93ae-92361f002671" |
|||
alias="WB6" |
|||
title="Widgets Bundle 6" |
|||
search_text="SYSTEM BUNDLE 1" |
|||
/> |
|||
<widgets_bundle |
|||
id="uuid'3beb4b1a-294d-11e7-93ae-92361f002671'" |
|||
id="3beb4b1a-294d-11e7-93ae-92361f002671" |
|||
alias="WB6" |
|||
title="Widgets Bundle 7" |
|||
search_text="ABC DEF" |
|||
/> |
|||
<!-- |
|||
<widgets_bundle |
|||
id="" |
|||
tenant_id="" |
|||
alias="" |
|||
title="" |
|||
search_text="" |
|||
/> |
|||
--> |
|||
</dataset> |
|||
@ -1,7 +1,17 @@ |
|||
cassandra.enabled=false |
|||
|
|||
sql.enabled=true |
|||
sql.datasource.url=jdbc:h2:mem:thingsboard |
|||
sql.datasource.username=sa |
|||
sql.datasource.password= |
|||
#sql.datasource.url=jdbc:h2:mem:thingsboard |
|||
#sql.datasource.username=sa |
|||
#sql.datasource.password= |
|||
#spring.jpa.hibernate.ddl-auto=create-drop |
|||
|
|||
spring.jpa.show-sql=false |
|||
spring.jpa.hibernate.ddl-auto=create-drop |
|||
|
|||
spring.database.driverClassName=org.postgresql.Driver |
|||
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect |
|||
spring.datasource.url=jdbc:postgresql://localhost:5432/thingsboard-test |
|||
spring.datasource.username=thingsboard |
|||
spring.datasource.password=thingsboard |
|||
spring.jpa.generate-ddl=true |
|||
|
|||
Loading…
Reference in new issue