@Test @DatabaseSetup("classpath:dbunit/empty_dataset.xml") public void testFindTenantsByRegion() { createTenants(); assertEquals(60, tenantDao.find().size()); List<Tenant> tenants1 = tenantDao.findTenantsByRegion("REGION_1", new TextPageLink(20,"title")); assertEquals(20, tenants1.size()); List<Tenant> tenants2 = tenantDao.findTenantsByRegion("REGION_1", new TextPageLink(20,"title", tenants1.get(19).getId().getId(), null)); assertEquals(10, tenants2.size()); List<Tenant> tenants3 = tenantDao.findTenantsByRegion("REGION_1", new TextPageLink(20,"title", tenants2.get(9).getId().getId(), null)); assertEquals(0, tenants3.size()); }
@Override public List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink) { return DaoUtil.convertDataList(tenantRepository .findByRegionNextPage( region, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }
JpaTenantDao extends JpaAbstractSearchTextDao<TenantEntity, Tenant> implements TenantDao { @Override public List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink) { return DaoUtil.convertDataList(tenantRepository .findByRegionNextPage( region, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); } }
JpaTenantDao extends JpaAbstractSearchTextDao<TenantEntity, Tenant> implements TenantDao { @Override public List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink) { return DaoUtil.convertDataList(tenantRepository .findByRegionNextPage( region, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }  }
JpaTenantDao extends JpaAbstractSearchTextDao<TenantEntity, Tenant> implements TenantDao { @Override public List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink) { return DaoUtil.convertDataList(tenantRepository .findByRegionNextPage( region, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }  @Override List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink); }
JpaTenantDao extends JpaAbstractSearchTextDao<TenantEntity, Tenant> implements TenantDao { @Override public List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink) { return DaoUtil.convertDataList(tenantRepository .findByRegionNextPage( region, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }  @Override List<Tenant> findTenantsByRegion(String region, TextPageLink pageLink);  }