@Test public void testFindCustomersByTenantIdAndTitle() { UUID tenantId = Uuids.timeBased(); for (int i = 0; i < 10; i++) { createCustomer(tenantId, i); } Optional<Customer> customerOpt = customerDao.findCustomersByTenantIdAndTitle(tenantId, "CUSTOMER_5"); assertTrue(customerOpt.isPresent()); assertEquals("CUSTOMER_5", customerOpt.get().getTitle()); }
@Override public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) { Customer customer = DaoUtil.getData(customerRepository.findByTenantIdAndTitle(tenantId, title)); return Optional.ofNullable(customer); }
JpaCustomerDao extends JpaAbstractSearchTextDao<CustomerEntity, Customer> implements CustomerDao { @Override public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) { Customer customer = DaoUtil.getData(customerRepository.findByTenantIdAndTitle(tenantId, title)); return Optional.ofNullable(customer); } }
JpaCustomerDao extends JpaAbstractSearchTextDao<CustomerEntity, Customer> implements CustomerDao { @Override public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) { Customer customer = DaoUtil.getData(customerRepository.findByTenantIdAndTitle(tenantId, title)); return Optional.ofNullable(customer); }  }
JpaCustomerDao extends JpaAbstractSearchTextDao<CustomerEntity, Customer> implements CustomerDao { @Override public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) { Customer customer = DaoUtil.getData(customerRepository.findByTenantIdAndTitle(tenantId, title)); return Optional.ofNullable(customer); }  @Override PageData<Customer> findCustomersByTenantId(UUID tenantId, PageLink pageLink); @Override Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title); }
JpaCustomerDao extends JpaAbstractSearchTextDao<CustomerEntity, Customer> implements CustomerDao { @Override public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) { Customer customer = DaoUtil.getData(customerRepository.findByTenantIdAndTitle(tenantId, title)); return Optional.ofNullable(customer); }  @Override PageData<Customer> findCustomersByTenantId(UUID tenantId, PageLink pageLink); @Override Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title);  }