@Test public void findByType() { for (int i = 0; i < 20; i++) { createComponentDescriptor(ComponentType.FILTER, ComponentScope.SYSTEM, i); createComponentDescriptor(ComponentType.ACTION, ComponentScope.TENANT, i + 20); } PageLink pageLink = new PageLink(15, 0, "COMPONENT_"); PageData<ComponentDescriptor> components1 = componentDescriptorDao.findByTypeAndPageLink(AbstractServiceTest.SYSTEM_TENANT_ID, ComponentType.FILTER, pageLink); assertEquals(15, components1.getData().size()); pageLink = pageLink.nextPageLink(); PageData<ComponentDescriptor> components2 = componentDescriptorDao.findByTypeAndPageLink(AbstractServiceTest.SYSTEM_TENANT_ID,ComponentType.FILTER, pageLink); assertEquals(5, components2.getData().size()); }
@Override public PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink) { return DaoUtil.toPageData(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink) { return DaoUtil.toPageData(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); } }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink) { return DaoUtil.toPageData(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }  }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink) { return DaoUtil.toPageData(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }  @Override Optional<ComponentDescriptor> saveIfNotExist(TenantId tenantId, ComponentDescriptor component); @Override ComponentDescriptor findById(TenantId tenantId, ComponentDescriptorId componentId); @Override ComponentDescriptor findByClazz(TenantId tenantId, String clazz); @Override PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink); @Override PageData<ComponentDescriptor> findByScopeAndTypeAndPageLink(TenantId tenantId, ComponentScope scope, ComponentType type, PageLink pageLink); @Override @Transactional void deleteById(TenantId tenantId, ComponentDescriptorId componentId); @Override @Transactional void deleteByClazz(TenantId tenantId, String clazz); }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink) { return DaoUtil.toPageData(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), DaoUtil.toPageable(pageLink))); }  @Override Optional<ComponentDescriptor> saveIfNotExist(TenantId tenantId, ComponentDescriptor component); @Override ComponentDescriptor findById(TenantId tenantId, ComponentDescriptorId componentId); @Override ComponentDescriptor findByClazz(TenantId tenantId, String clazz); @Override PageData<ComponentDescriptor> findByTypeAndPageLink(TenantId tenantId, ComponentType type, PageLink pageLink); @Override PageData<ComponentDescriptor> findByScopeAndTypeAndPageLink(TenantId tenantId, ComponentScope scope, ComponentType type, PageLink pageLink); @Override @Transactional void deleteById(TenantId tenantId, ComponentDescriptorId componentId); @Override @Transactional void deleteByClazz(TenantId tenantId, String clazz);  }