spring-data 相关问题

Spring Data是一个伞形开源项目,它包含许多特定于给定数据库的子项目。这些项目是通过与这些激动人心的技术背后的许多公司和社区合作开发的。

如何让mongodb返回一个带有@id和没有href的对象?

如标题所述,我使用mongodb保存对象,我的@id字符串有问题。当我想要它在我的对象中时,@ id会发送一种包装器。所以,在阅读我的Json时,我获得了......

回答 1 投票 0

如何使用Spring Boot从不同的包中自动装配存储库接口?

我是Spring Boot的新手,想要从Rest Controller中的不同包中自动装配存储库。看来,当我将接口和实现放在不同的包中时,实际......

回答 3 投票 3

Spring Boot创建动态数据源:当前正在创建请求的bean:是否存在无法解析的循环引用?

@Bean(name =“masterDataSource”)@ Primary @ConfigurationProperties(prefix =“spring.datasource.master”)public DataSource masterDataSource(){DruidDataSource dataSource = new DruidDataSource(); ...

回答 2 投票 2

spring数据 - Mongodb - findBy嵌套对象的方法

我有两个域对象,@ Document公共类PracticeQuestion {private int userId;私人清单 问题; // Getters and setters} @Document public class Question {...

回答 3 投票 18

spring-data-2.0.6 java.lang.IllegalArgumentException:找不到类型为HibernateProxy的PersistentEntity

尝试访问关联的HibernateProxy实例(延迟提取的关联)时,Spring数据失败。这些最新版本出现错误:spring-data-2.0.6.RELEASE org.hibernate:hibernate -...

回答 1 投票 0

查询方法中的Spring Data可选参数

我想在存储库层中编写一些查询方法。此方法必须忽略null参数。例如:列表 findByBarAndGoo(Bar barParam,@ optional Goo gooParam);这种方法必须......

回答 4 投票 28

从方法名称禁用查询创建 - 使用投影

我想使用Spring Data Projection技术,只从表中提取一些字段(而不是表的所有字段)。如文档中所述(https://docs.spring.io / ...

回答 2 投票 3

Spring Boot / Spring数据集成测试

没有设法配置Spring Boot进行集成测试。冷,请你看看下面的代码:实体@Entity(name =“Item”)@Table(name =“item”)@Inheritance(strategy = ...

回答 3 投票 0

如何修复CrudRepository.save(java.lang.Object)是springboot中的无法访问方法?

我指的是这个春季启动教程,我在我的项目中使用spring数据,我试图将数据添加到数据库。使用以下内容。当我试图这样做时,我得到一个错误说...

回答 2 投票 3

Hibernate 5.x和Spring Data 2.x:如何在服务保存方法中更新原始对象

我正在升级一个Web应用程序:Spring(MVC)4.2.9.RELEASE,Hibernate 4.3.8.Final,以及1.7.1.RELEASE到Spring(MVC)5.0.2.RELEASE,Hibernate 5.2.12.Final,以及Spring Data 2.0.2.RELEASE。 ...

回答 1 投票 0

spring-jpa规格工具

我想在spring jpa下执行这个sql。但我无法使用Specification接口来构建规范。你能告诉我吗? select * from(从...中选择不同的user_uid

回答 1 投票 1

如何将PageRequest对象转换为查询字符串?

我正在编写一个RESTful API,它使用另一个RESTful Data API,而我正在使用Spring Data。客户端使用查询参数发送页面请求,例如:http://api.mysite.com/products?page = 1&...

回答 3 投票 2

Spring Data JPA Custom Repository

尝试使用Spring Data JPA实现自定义存储库时,我遇到了一些问题。我尝试按照这样的一些参考指南,但我找不到问题:https://docs.spring.io/spring-data / ...

回答 2 投票 0

使用Spring-data-cassandra查询具有复合主键的表

我在使用CassandraReporitory的findOne()或findAll()方法时遇到以下异常:引起:java.lang.IllegalStateException:property没有单列映射...

回答 2 投票 4

@Query(Spring data / JPA),其中boolean在where条件中

SampleRepository.java类有如下查询:@Query(“从eq.inquiry中选择来自EmailQueue eq的eq(从查询问题中选择issue.id,其中issue.id = eq.inquiry和systimestamp> = ...

回答 2 投票 0

如何使用Spring Data ElasticsearchTemplate连接到Amazon Elasticsearch Service?

我在Amazon Elasticsearch Service上运行了我的Elasticsearch集群。我试图找到如何将我的Java应用程序连接到该Elasticsearch集群的解决方案,但我找不到任何...

回答 1 投票 2

包含Spring Data会破坏Spring Boot应用程序中的自动序列化

我最近在我的项目中添加了Spring-data,然后我发现在我的REST控制器中,客户端提供的模型不再是从JSON自动序列化的。我怎样才能解决这个问题?一世 ...

回答 1 投票 0

需要一个无法找到的'com.example.dao.InterfaceName'类型的bean

我正在使用Eclipse和maven与Java 1.8尝试构建一个基于maven项目的Spring启动项目,所以我使用这个完整的代码块包com来构建我自己的实体underName Candidat ....

回答 2 投票 1

如何让Spring的Data Rest Repository按名称而不是id来检索数据

我使用spring-boot-starter-data-rest中的Spring Data的Rest Repositories,Couchbase用作下划线DBMS。我对象的Pojo设置如此。 @Document public class Item {...

回答 2 投票 0

使用命令行运行器在Spring启动应用程序中创建Bean

@SpringBootApplication公共类ReactiveCouchbaseExample1Application {@Bean CommandLineRunner employees(ApplicationContext context){EmployeeRepository repository = context.getBean(...

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.