@Test public void testFindDashboardsByTenantId() { UUID tenantId1 = Uuids.timeBased(); UUID tenantId2 = Uuids.timeBased(); for (int i = 0; i < 20; i++) { createDashboard(tenantId1, i); createDashboard(tenantId2, i * 2); } PageLink pageLink = new PageLink(15, 0, "DASHBOARD"); PageData<DashboardInfo> dashboardInfos1 = dashboardInfoDao.findDashboardsByTenantId(tenantId1, pageLink); Assert.assertEquals(15, dashboardInfos1.getData().size()); PageData<DashboardInfo> dashboardInfos2 = dashboardInfoDao.findDashboardsByTenantId(tenantId1, pageLink.nextPageLink()); Assert.assertEquals(5, dashboardInfos2.getData().size()); }
@Override public PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink) { return DaoUtil.toPageData(dashboardInfoRepository .findByTenantId( tenantId, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }
JpaDashboardInfoDao extends JpaAbstractSearchTextDao<DashboardInfoEntity, DashboardInfo> implements DashboardInfoDao { @Override public PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink) { return DaoUtil.toPageData(dashboardInfoRepository .findByTenantId( tenantId, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); } }
JpaDashboardInfoDao extends JpaAbstractSearchTextDao<DashboardInfoEntity, DashboardInfo> implements DashboardInfoDao { @Override public PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink) { return DaoUtil.toPageData(dashboardInfoRepository .findByTenantId( tenantId, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }  }
JpaDashboardInfoDao extends JpaAbstractSearchTextDao<DashboardInfoEntity, DashboardInfo> implements DashboardInfoDao { @Override public PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink) { return DaoUtil.toPageData(dashboardInfoRepository .findByTenantId( tenantId, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }  @Override PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink); @Override PageData<DashboardInfo> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, PageLink pageLink); }
JpaDashboardInfoDao extends JpaAbstractSearchTextDao<DashboardInfoEntity, DashboardInfo> implements DashboardInfoDao { @Override public PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink) { return DaoUtil.toPageData(dashboardInfoRepository .findByTenantId( tenantId, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }  @Override PageData<DashboardInfo> findDashboardsByTenantId(UUID tenantId, PageLink pageLink); @Override PageData<DashboardInfo> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, PageLink pageLink);  }