@Test public void findByType() { for (int i = 0; i < 20; i++) { createComponentDescriptor(ComponentType.FILTER, ComponentScope.SYSTEM, i); createComponentDescriptor(ComponentType.ACTION, ComponentScope.TENANT, i + 20); } TextPageLink pageLink1 = new TextPageLink(15, "COMPONENT_"); List<ComponentDescriptor> components1 = componentDescriptorDao.findByTypeAndPageLink(ComponentType.FILTER, pageLink1); assertEquals(15, components1.size()); TextPageLink pageLink2 = new TextPageLink(15, "COMPONENT_", components1.get(14).getId().getId(), null); List<ComponentDescriptor> components2 = componentDescriptorDao.findByTypeAndPageLink(ComponentType.FILTER, pageLink2); assertEquals(5, components2.size()); }
@Override public List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink) { return DaoUtil.convertDataList(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink) { return DaoUtil.convertDataList(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); } }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink) { return DaoUtil.convertDataList(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }  }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink) { return DaoUtil.convertDataList(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }  @Override Optional<ComponentDescriptor> saveIfNotExist(ComponentDescriptor component); @Override ComponentDescriptor findById(ComponentDescriptorId componentId); @Override ComponentDescriptor findByClazz(String clazz); @Override List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink); @Override List<ComponentDescriptor> findByScopeAndTypeAndPageLink(ComponentScope scope, ComponentType type, TextPageLink pageLink); @Override @Transactional void deleteById(ComponentDescriptorId componentId); @Override @Transactional void deleteByClazz(String clazz); }
JpaBaseComponentDescriptorDao extends JpaAbstractSearchTextDao<ComponentDescriptorEntity, ComponentDescriptor> implements ComponentDescriptorDao { @Override public List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink) { return DaoUtil.convertDataList(componentDescriptorRepository .findByType( type, Objects.toString(pageLink.getTextSearch(), ""), pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()), new PageRequest(0, pageLink.getLimit()))); }  @Override Optional<ComponentDescriptor> saveIfNotExist(ComponentDescriptor component); @Override ComponentDescriptor findById(ComponentDescriptorId componentId); @Override ComponentDescriptor findByClazz(String clazz); @Override List<ComponentDescriptor> findByTypeAndPageLink(ComponentType type, TextPageLink pageLink); @Override List<ComponentDescriptor> findByScopeAndTypeAndPageLink(ComponentScope scope, ComponentType type, TextPageLink pageLink); @Override @Transactional void deleteById(ComponentDescriptorId componentId); @Override @Transactional void deleteByClazz(String clazz);  }