Questions tagged [spring-data]

Spring Data is an umbrella open source project which contains many subprojects that are specific to a given database. The projects are developed by working together with many of the companies and community that are behind these exciting technologies.

The primary goal of the Spring Data project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services as well as provide improved support for relational database technologies.

This is an umbrella project which contains many subprojects that are specific to a given database. The projects are developed by working together with many of the companies and developers that are behind these exciting technologies.


Spring Data modules and specific tags

Noteworthy Questions and Answers

Are you supposed to have one repository per table in JPA?

11873 questions
9 answers

What is difference between CrudRepository and JpaRepository interfaces in Spring Data JPA?

What is the difference between CrudRepository and JpaRepository interfaces in Spring Data JPA? When I see the examples on the web, I see them there used kind of interchangeably. What is the difference between them? Why would you want to use one…
  • 10,783
  • 3
  • 15
  • 7
33 answers

How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

I am trying to work with Spring Data and Neo4j. I started by trying to follow this guide linked to by the main site. In particular I based my pom.xml off of the "Hello, World!" example file. Here is a snip from my pom.xml for the plugin that is…
Andrew White
  • 52,720
  • 19
  • 113
  • 137
21 answers

Easy way to convert Iterable to Collection

In my application I use 3rd party library (Spring Data for MongoDB to be exact). Methods of this library return Iterable, while the rest of my code expects Collection. Is there any utility method somewhere that will let me quickly convert one…
Ula Krukar
  • 12,549
  • 20
  • 51
  • 65
9 answers

How to use OrderBy with findAll in Spring Data

I am using spring data and my DAO looks like public interface StudentDAO extends JpaRepository { public findAllOrderByIdAsc(); // I want to use some thing like this } In above code, commented line shows my intent. Can…
Prashant Shilimkar
  • 8,402
  • 13
  • 54
  • 89
22 answers

Spring Boot - Loading Initial Data

I'm wondering what the best way to load initial database data before the application starts? What I'm looking for is something that will fill my H2 database with data. For example, I have a domain model "User" I can access users by going to /users…
  • 3,793
  • 7
  • 23
  • 32
4 answers

What is this property in Spring Boot?

I saw property in Spring Boot documentation for JPA configuration. Is the true default value for this property if it's not provided at all?; What does this really do? I did not find any good explaining for it; Does it…
Carlos Alberto
  • 7,761
  • 13
  • 52
  • 72
3 answers

Spring CrudRepository findByInventoryIds(List inventoryIdList) - equivalent to IN clause

In Spring CrudRepository, do we have support for "IN clause" for a field? ie something similar to the following? findByInventoryIds(List inventoryIdList) If such support is not available, what elegant options can be considered? Firing…
  • 5,378
  • 4
  • 35
  • 66
33 answers

Spring boot - Not a managed type

I use Spring boot+JPA and having a problem while starting the service. Caused by: java.lang.IllegalArgumentException: Not an managed type: class com.nervytech.dialer.domain.PhoneSettings at…
  • 7,808
  • 29
  • 108
  • 206
16 answers

Unable to find a @SpringBootConfiguration when doing a JpaTest

I'm trying to run a simple Junit test to see if my CrudRepositories are indeed working. The error I keep getting is: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your…
Thomas Billet
  • 2,381
  • 2
  • 13
  • 13
36 answers

Spring Boot - Cannot determine embedded database driver class for database type NONE

This is the error that is thrown when trying to run my web app: [INFO] WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name…
  • 33,478
  • 73
  • 290
  • 513
13 answers

How to add custom method to Spring Data JPA

I am looking into Spring Data JPA. Consider the below example where I will get all the crud and finder functionality working by default and if I want to customize a finder then that can be also done easily in the interface…
Sharad Yadav
  • 2,951
  • 5
  • 20
  • 18
13 answers

Disable all Database related auto configuration in Spring Boot

I am using Spring Boot to develop two applications, one serves as the server and other one is a client app. However, both of them are the same app that function differently based on the active profile. I am using auto configuration feature of Spring…
  • 3,108
  • 4
  • 20
  • 35
11 answers

How to test Spring Data repositories?

I want a repository (say, UserRepository) created with the help of Spring Data. I am new to spring-data (but not to spring) and I use this tutorial. My choice of technologies for dealing with the database is JPA 2.1 and Hibernate. The problem is…
  • 2,053
  • 2
  • 13
  • 8
7 answers

When use getOne and findOne methods Spring Data JPA

I have an use case where it calls the following: @Override @Transactional(propagation=Propagation.REQUIRES_NEW) public UserControl getUserControlById(Integer id){ return this.userControlRepository.getOne(id); } Observe the @Transactional has…
Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
7 answers

How to fetch FetchType.LAZY associations with JPA and Hibernate in a Spring Controller

I have a Person class: @Entity public class Person { @Id @GeneratedValue private Long id; @ManyToMany(fetch = FetchType.LAZY) private List roles; // etc } With a many-to-many relation that is lazy. In my controller I…
  • 21,083
  • 19
  • 56
  • 89
2 3
99 100