@Test @DatabaseSetup("classpath:dbunit/user.xml") public void testSave() throws IOException { User user = new User(); user.setId(new UserId(UUID.fromString("cd481534-27cc-11e7-93ae-92361f002671"))); user.setTenantId(new TenantId(UUID.fromString("1edcb2c6-27cb-11e7-93ae-92361f002671"))); user.setCustomerId(new CustomerId(UUID.fromString("51477cb4-27cb-11e7-93ae-92361f002671"))); user.setEmail("user@thingsboard.org"); user.setFirstName("Jackson"); user.setLastName("Roberts"); ObjectMapper mapper = new ObjectMapper(); String additionalInfo = "{\"key\":\"value-100\"}"; JsonNode jsonNode = mapper.readTree(additionalInfo); user.setAdditionalInfo(jsonNode); userDao.save(AbstractServiceTest.SYSTEM_TENANT_ID,user); assertEquals(6, userDao.find(AbstractServiceTest.SYSTEM_TENANT_ID).size()); User savedUser = userDao.findByEmail(AbstractServiceTest.SYSTEM_TENANT_ID,"user@thingsboard.org"); assertNotNull(savedUser); assertEquals(additionalInfo, savedUser.getAdditionalInfo().toString()); }
@Override public User findByEmail(TenantId tenantId, String email) { return DaoUtil.getData(userRepository.findByEmail(email)); }
JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao { @Override public User findByEmail(TenantId tenantId, String email) { return DaoUtil.getData(userRepository.findByEmail(email)); } }
JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao { @Override public User findByEmail(TenantId tenantId, String email) { return DaoUtil.getData(userRepository.findByEmail(email)); }  }
JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao { @Override public User findByEmail(TenantId tenantId, String email) { return DaoUtil.getData(userRepository.findByEmail(email)); }  @Override User findByEmail(TenantId tenantId, String email); @Override PageData<User> findByTenantId(UUID tenantId, PageLink pageLink); @Override PageData<User> findTenantAdmins(UUID tenantId, PageLink pageLink); @Override PageData<User> findCustomerUsers(UUID tenantId, UUID customerId, PageLink pageLink); }
JpaUserDao extends JpaAbstractSearchTextDao<UserEntity, User> implements UserDao { @Override public User findByEmail(TenantId tenantId, String email) { return DaoUtil.getData(userRepository.findByEmail(email)); }  @Override User findByEmail(TenantId tenantId, String email); @Override PageData<User> findByTenantId(UUID tenantId, PageLink pageLink); @Override PageData<User> findTenantAdmins(UUID tenantId, PageLink pageLink); @Override PageData<User> findCustomerUsers(UUID tenantId, UUID customerId, PageLink pageLink);  }