12,032 questions
1012
votes
32
answers
1.3m
views
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 ...
506
votes
21
answers
447k
views
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<T>, while the rest of my code expects Collection<T>.
Is there any ...
460
votes
9
answers
689k
views
How to use OrderBy with findAll in Spring Data
I am using spring data and my DAO looks like
public interface StudentDAO extends JpaRepository<StudentEntity, Integer> {
public findAllOrderByIdAsc(); // I want to use some thing like ...
332
votes
4
answers
340k
views
What is this spring.jpa.open-in-view=true property in Spring Boot?
I saw spring.jpa.open-in-view=true 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 ...
315
votes
22
answers
538k
views
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 ...
300
votes
34
answers
675k
views
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 org....
285
votes
3
answers
405k
views
Spring CrudRepository findByInventoryIds(List<Long> 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<Long> inventoryIdList)
If such support is not ...
242
votes
16
answers
309k
views
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 ...
242
votes
36
answers
626k
views
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 'org.springframework....
229
votes
14
answers
287k
views
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, that can be also done ...
211
votes
13
answers
329k
views
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....
199
votes
11
answers
332k
views
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 ...
191
votes
7
answers
275k
views
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....
187
votes
7
answers
267k
views
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<Role> roles;
// etc
}
With a ...
176
votes
1
answer
52k
views
How are Spring Data repositories actually implemented?
I have been working with Spring Data JPA repository in my project for some time and I know the below points:
In the repository interfaces, we can add the methods like findByCustomerNameAndPhone() (...