-
5 votesanswersviews
Spring Data REST的QueryDSL集成,用于查询实体中集合映射的子属性
进行了一些重要的挖掘,以确定使用query-dsl的spring-data-rest可以让REST API客户端轻松过滤实体的大多数属性 . 这个问题也很有用:Can Spring Data REST's QueryDSL integration be used to perform more complex queries? 正如Dennis Laumen已经提到的那样, QueryDslPre... -
0 votesanswersviews
无法找到Spring User,Spring Data Java的UserDAO类型的Bean
我能错过什么? 描述:com.solopov.hillel.uquiz.service.UserService中的字段userDAO需要一个无法找到的类型为“com.solopov.hillel.uquiz.dao.UserDAO”的bean . 操作:考虑在配置中定义类型为“com.solopov.hillel.uquiz.dao.UserDAO”的bean . 主要课程: package ... -
1 votesanswersviews
考虑在配置中定义类型为'com.repository.UserRepository'的bean
嗨我正在使用Spring配置中的Java配置进行JPA和Hibernate配置,并且我在这个错误中坚持数小时 . 即使我已将UserRepository声明为bean仍然无法获取存储库 . package com.repository; @Repository public interface UserRepository extends JpaRepository<User, Long&... -
0 votesanswersviews
Spring Data REST如何在json中返回hibernate-JPA验证和服务器内部错误而不是堆栈跟踪
我希望在 JSON 格式上获得JPA验证和服务器内部错误,而不是堆栈跟踪, 使用 Spring JPA data rest MyEntity Repository @RepositoryRestResource(path = "entity") public interface MyEntityRepo extends CrudRepository<MyEntity,... -
0 votesanswersviews
在Spring-Data中分离存储库和实现
鉴于一些抽象实体: public interface Person{ long getID(); String getFirstName(); String getLastName(); } 和存储库一起使用这个实体: public interface PersonRepository { void save(Person person); Pe... -
62 votesanswersviews
如何在Spring Data中使用@Transactional?
我刚刚开始研究Spring-data,Hibernate,MySQL,JPA项目 . 我切换到spring-data,这样我就不用担心手工创建查询了 . 我注意到 @Transactional 使用spring-data是因为我在没有注释的情况下尝试了我的查询 . 我应该/不应该使用 @Transactional 注释的具体原因是什么? 作品: @Transactional public List... -
78 votesanswersviews
Spring Data:支持“删除”吗?
我使用Spring JPA进行数据库访问 . 我能够找到像findByName和countByName这样的例子,我没有必要编写任何方法实现 . 我希望找到基于某些条件删除一组记录的示例 . Spring JPA是否支持deleteByName-like delete?任何指针都很受欢迎 . 问候和感谢 . -
27 votesanswersviews
如何在Spring Boot中使用Spring管理的Hibernate拦截器?
是否有可能在Spring Boot中集成Spring托管的Hibernate拦截器(http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch14.html)? 我正在使用Spring Data JPA和Spring Data REST,并且需要一个Hibernate拦截器来对实体上的特定字段进行更新 . 使用标准JPA事件,不可能获得... -
4 votesanswersviews
Spring数据是否需要休眠
我对 spring 数据的实现有一个疑问,对 spring 数据有基本的了解 . 我理解JPA和Hibernate,它是如何工作的 . Hibernate为JPA提供了实现 . 我的问题,我们可以单独使用Spring数据来保存mysql中的数据,还是需要一些提供者,如hibernate或toplink等,用于中型应用程序 -
1 votesanswersviews
我不能在窗户上运行 spring 靴
我开始研究一个项目,我正在使用Windows . 基本上我可以使用maven生成一个Jar文件,但是当我尝试运行我的Jar文件时它不能正常工作 . 听起来它没有找到hibernate属性 . 我的错误: 2017-01-15 16:03:12.454 INFO 19012 --- [main] org.hibernate.Version : HHH... -
3 votesanswersviews
确定spring集成中循环工作流的结束(inbound-channel => service-activator)
我们有以下简单的基于int-jpa的工作流程: [inbound-channel-adapter] - > [service-activator] 配置是这样的: <int:channel id="inChannel"> <int:queue/> </int:channel> <int:channel id="out... -
0 votesanswersviews
查找嵌套资源的实践
可以说我有一个REST资源,如: /公司/ {} companyId /部门/ {}的DepartmentID /员工/ {}雇员 和CompanyEntity具有 List<DepartementEntity> 且DepartmentEntity具有 List<EmployeeEntity> 的实体类 . 所有ID都是唯一的 . 所以现在有人在打电话 GET /compa... -
2 votesanswersviews
Hibernate Version Counter需要在刷新后刷新才能正确
所有, 我们正在使用 Hibernate 4.2.14.Final , Hibernate JPA API 2.0 和 Spring Data JPA 1.7.0.RELEASE . 我们的交易通过JTA Container管理的交易进行管理 . I am seeing an issue where the version counter of a child entity is coming ... -
1 votesanswersviews
无法向所有存储库添加自定义行为 - IllegalArgumentException:不是托管类型
我已经实现了我在这里描述的代码http://docs.spring.io/spring-data/data-jpa/docs/current/reference/html/#repositories.custom-behaviour-for-all-repositories,但是有些东西是错的,它不起作用 . 总是收到此错误: java.lang.IllegalStateException: Fa... -
2 votesanswersviews
Spring数据JPA Repository Match All Columns或整个pojo
我试图搜索但没有找到准确的解决方案 . 我有 Address 实体 . 对于每个新的Address请求,首先我要检查数据库中是否存在相同的地址请求 . 我的申请是针对仓库的,并且有可能多次同一地址请求 . Address Entity @Entity @NamedQuery(name="Address.findAll", query="SELECT a FROM Ad... -
2 votesanswersviews
如何获取Spring Data JPA Repository Factory?
由于我没有得到my previous question的答案,我试图调整Spring documentation中给出的用于自定义存储库的示例 . 有一个方法 getRepository(Class repositoryInterface) ,它看起来像是映射我的存储库的正确位置覆盖: public class MyRepositoryFactoryBean<R extends JpaRep... -
0 votesanswersviews
spring-data-rest,所有存储库的通用自定义方法
我尝试为我的所有spring-data-rest存储库创建一个基本功能,但是存在一个问题 . spring的版本是4.2.4,我有UserRepository,绑定到相对User实体,也是一个管理多repo相关逻辑的UserController . 我想在我的所有存储库中添加一个自定义方法 sharedCustomMethod ,包括UserRepository . 我有BaseRepositor... -
43 votesanswersviews
如何在Spring容器之外使用Spring Data JPA?
我正在尝试手动连接Spring Data JPA对象,以便我可以生成DAO代理(也称为存储库) - 而无需使用Spring bean容器 . 不可避免地,我会被问到为什么要这样做:这是因为我们的项目已经在使用Google Guice(并且在使用Gin和GWT的UI上),我们不会't want to maintain another IoC container configuration, or p... -
1 votesanswersviews
spring数据JPA / Hibernate . 复杂的交叉表SQL,它不映射到表实体
*** Edited with possible solution - any comments ? *** Spring 天4.2.5发布 我开始在Legacy数据库上创建Java Web服务 . 遵循spring-data JPA存储库模式创建映射到表的实体,扩展CrudRepository的存储库运行良好 . As described in this great tutorial 我见过的所... -
0 votesanswersviews
没有持久单元名称的Spring jpa
我正在开发一个应用程序,我们将Spring Jpa与OpenJpa一起使用 . 我们仅将Spring Jpa用于本机查询,而不使用任何持久化类 . 因为我没有任何持久化类,所以我从bean定义中排除了持久性单元名称,并且我没有任何persistent.xml . 我想了解是否可以使用持久的单位名称注册实体管理器? Spring 天会看到其他 jar 的持久性类吗? -
0 votesanswersviews
Spring Data Jpa是否支持存储库继承以及如何操作?
我有一个简单的实体继承树,由以下组成: abstract class Item (id, ...) class Chart extends Item (...) class Table extends Item (...) 每个类都有自己的存储库: ItemRepository , ChartRepository 和 TableRepository . 所有三个存储库都是 exposed .... -
0 votesanswersviews
Spring Data JPA仍在尝试为自定义实现生成查询方法
我目前正在使用带有Spring Data JPA 2.0.2的Kotlin 1.2和Spring Boot 2.0 M7 . 在这里,我试图创建一个自定义实现的存储库 . 我的参考是https://docs.spring.io/spring-data/jpa/docs/2.0.2.RELEASE/reference/html/#repositories.custom-implementations... -
0 votesanswersviews
为什么我们在创建存储库时需要创建xxxCustom和xxxImpl类?
根据这些信息,当我们创建存储库类时,最好为一个存储库UserRepository(接口),UserRepositoryCustom(类),UserRepositoryImpl(接口)创建1个类和2个接口 . http://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.custom-implement... -
1 votesanswersviews
如何在spring数据中扩展RepositoryDefinition批注?
我们知道,有两种方法可以在Spring数据中定义存储库 . 一个是扩展接口(例如自己的 JpaRepository ),第二个是使用RepositoryDefinition注释 . 我扩展了JpaRepository并创建了自己的接口,存储库扩展了它 . 使用我自己的RepositoryFactoryBean,我可以决定在spring上下文中应该将哪个实现作为存储库注入 . 例如你可以看到http... -
0 votesanswersviews
Spring Data自定义基础存储库elasticsearchrepository
不知道我是多少经历了多个堆栈溢出问题和https://docs.spring.io/spring-data/data-commons/docs/current/reference/html/#repositories.customize-base-repository 这是我的实施 配置文件 @Configuration @EnableJpaRepositories(repositoryBaseC... -
1 votesanswersviews
Spring Boot没有自动装配@Repository
我'm trying to configure a datasource with Spring Boot but I'得到 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationServiceImpl': Injection of autowire... -
1 votesanswersviews
如何在Spring JPA中实现缓存
我想在Spring jpa存储库中使用带有java配置的Ehcache(而不是xml)来实现缓存功能 . 但我对@cache,@ caceevict,@ cacheable,@caching annotations感到困惑 . 1)我想从缓存中获取数据,如果数据在缓存中不可用,那么它应该从数据库中获取 . 2)来自控制器,如果我点击/ api / cacheRefresh,它应该刷新所有表 . -
19 votesanswersviews
spring-data-jpa和spring-boot-starter-data-jpa之间的区别
这可能不是最好的问题,但我注意到Spring引导有2个Spring JPA . 他们有什么不同 . 目前我正在尝试与hibernate一起设置SpringBoot 1.5.3项目 . 我记得我之前使用spring-boot-starter-data-jpa设置了Springboot和JPA . 我见过的大多数在线示例以及starter.spring.io都为spring jpa提供了以下依赖项 .... -
1 votesanswersviews
是Spring @Controller rsp . @RestController与spring-data-jpa存储库的事务处理?它看起来像
我正在关注http://www.baeldung.com/spring-boot-start的Spring-boot教程,该教程使用 spring-boot-starter-web 以及 spring-boot-starter-data-jpa 而无需自定义 . 我的 spring-boot-starter-parent -version是 1.5.10.RELEASE . 这是一个简单的RE... -
2 votesanswersviews
集成Spring-boot,Spring-batch,Spring-data-jpa进行事务管理的问题
我面临与事务管理相关的问题(特别是需要新的事务注释),详情如下: 我使用了Spring-boot(1.1.5.RELEASE) . spring-boot-starter-batch b . spring-boot-starter-data-jpa另外为此我使用了hibernate最新版本 我的jpa配置相关代码如下: @Configuration @ComponentScan @Enab...