JpaCustomerDao extends JpaAbstractSearchTextDao<CustomerEntity, Customer> implements CustomerDao { @Override public Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title) { Customer customer = DaoUtil.getData(customerRepository.findByTenantIdAndTitle(UUIDConverter.fromTimeUUID(tenantId), title)); return Optional.ofNullable(customer); }  @Override List<Customer> findCustomersByTenantId(UUID tenantId, TextPageLink pageLink); @Override Optional<Customer> findCustomersByTenantIdAndTitle(UUID tenantId, String title);  }
@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()); }