草庐IT

jazn-data

全部标签

spring - 如何使用 Spring Data Repositories 处理大量数据?

我有一个大表,我想通过SpringDataRepository访问它。目前,我正在尝试扩展PagingAndSortingRepository接口(interface),但似乎我只能定义返回列表的方法,例如:publicinterfaceMyRepositoryextendsPagingAndSortingRepository{@Query(value="SELECT*...")ListmyQuery(Pageablep);}另一方面,PagingAndSortingRepository附带的findAll()方法返回一个Iterable(我认为数据不是加载到内存中)。是否可以定义同时

java - Spring Data PageImpl 没有返回正确大小的页面?

我正在尝试创建一个新的Page使用从数据库中检索到的对象列表。首先,我从数据库中获取所有元素,将其转换为Stream,然后使用lambda过滤结果。然后我需要一个具有一定数量元素的页面,但是,实例化一个新的PageImpl似乎没有返回大小正确的页面。这是我的代码:ListlistaFinal;Streamstream=produtosRepository.findAll().stream();listaFinal=stream.filter(p->p.getProdNome().contains("uio")).collect(Collectors.toList());longtota

java - Spring Data PageImpl 没有返回正确大小的页面?

我正在尝试创建一个新的Page使用从数据库中检索到的对象列表。首先,我从数据库中获取所有元素,将其转换为Stream,然后使用lambda过滤结果。然后我需要一个具有一定数量元素的页面,但是,实例化一个新的PageImpl似乎没有返回大小正确的页面。这是我的代码:ListlistaFinal;Streamstream=produtosRepository.findAll().stream();listaFinal=stream.filter(p->p.getProdNome().contains("uio")).collect(Collectors.toList());longtota

java - 在 Spring Data Commons 2.0.4 中找不到 QueryDslPredicateExecutor

我花了几个小时在spring数据中找到QueryDslPredicateExecutor。为什么叫它QueryDslPredicateExecutor在文档和博客中,但QuerydslPredicateExecutor(小D!)在工件2.0.4.RELEASE中?在哪个版本是正确的? 最佳答案 在2.x中从QueryDslPredicateExecutor重命名为QuerydslPredicateExecutor。见https://github.com/spring-projects/spring-data-commons/comm

java - 在 Spring Data Commons 2.0.4 中找不到 QueryDslPredicateExecutor

我花了几个小时在spring数据中找到QueryDslPredicateExecutor。为什么叫它QueryDslPredicateExecutor在文档和博客中,但QuerydslPredicateExecutor(小D!)在工件2.0.4.RELEASE中?在哪个版本是正确的? 最佳答案 在2.x中从QueryDslPredicateExecutor重命名为QuerydslPredicateExecutor。见https://github.com/spring-projects/spring-data-commons/comm

java - 将业务逻辑添加到 spring-data-rest 应用程序

我一直在尝试使用spring-data-rest(SDR),我对构建restapi的速度印象深刻。我的应用程序基于以下存储库,它为我提供了GET/attachements和POST/attachementspackagecom.deepskyblue.attachment.repository;importjava.util.List;importorg.springframework.data.repository.Repository;importcom.deepskyblue.attachment.domain.Attachment;publicinterfaceAttachme

java - 将业务逻辑添加到 spring-data-rest 应用程序

我一直在尝试使用spring-data-rest(SDR),我对构建restapi的速度印象深刻。我的应用程序基于以下存储库,它为我提供了GET/attachements和POST/attachementspackagecom.deepskyblue.attachment.repository;importjava.util.List;importorg.springframework.data.repository.Repository;importcom.deepskyblue.attachment.domain.Attachment;publicinterfaceAttachme

Spring Data Rest 可分页子集合

我有一个名为User的@Entity。它有一组变更集如下:@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL,mappedBy="user")privateSetchangesets=newHashSet();我有一个UserRepository:@Repository@RestResource(path="users",rel="users")publicinterfaceUserRepositoryextendsJpaRepository{}还有一个ChangesetRepository:@Repository@RestR

Spring Data Rest 可分页子集合

我有一个名为User的@Entity。它有一组变更集如下:@OneToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL,mappedBy="user")privateSetchangesets=newHashSet();我有一个UserRepository:@Repository@RestResource(path="users",rel="users")publicinterfaceUserRepositoryextendsJpaRepository{}还有一个ChangesetRepository:@Repository@RestR

java.lang.NoClassDefFoundError : org/springframework/data/repository/config/BootstrapMode

我正在使用springboot做这个项目,我尝试编写一些测试,但遗憾的是我得到了这个异常堆栈跟踪:java.lang.IllegalStateException:FailedtoloadApplicationContextCausedby:org.springframework.beans.factory.BeanDefinitionStoreException:Failedtoreadcandidatecomponentclass:file[somepath/config/PostgresJpaConfig.class];nestedexceptionisjava.lang.NoCl