spring-data-jpa Questions
2
Is there a way to map properties of Sort objects? Just a little example:
a Dto
public class OrderDto {
private long totalAmount;
private long openAmount;
}
and an entity
@Entity
public class Ord...
Enforcement asked 6/7, 2021 at 12:44
4
Solved
Im currently using the standard jparepository method repository.deleteAll() to clean my table before adding new info. The table consists of 8300 rows with 5 columns each. It's currently taking abou...
Rammish asked 25/10, 2018 at 12:19
11
Solved
What is the simplest way of declaring a Spring data JPA query that uses properties of an input parameter as query parameters?
For example, suppose I have an entity class:
public class Person {
@...
Neocolonialism asked 29/5, 2012 at 16:7
2
My initial requirement was to fetch Car details as:
List<String> carMake = getUserCarMake();
Page<Car> carDetails = carRepository.findAllCarsInfo(carMake, pageRequest);
CarRepository...
Homs asked 6/9, 2019 at 4:53
14
Solved
I have one requirement is to search by pageable and non-pageable,
and in my Java code, I use spring data jpa Pageable class,
Pageable pageable = new PageRequest(
queryForm.getPageNumber()- 1, q...
Zaibatsu asked 20/5, 2014 at 4:46
5
Solved
spring.jpa.properties.hibernate.dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect
I have a Spring Boot v1.5 application with Hibernate 5 running a Postgis database. However, I'm having...
Duncandunce asked 5/6, 2019 at 9:45
3
When I run my Spring Boot application, everything works fine: Hibernate generates tables and populates them with a LoadDatabase configuration class.
I have a TestController that I use to test wheth...
Entity asked 1/5, 2023 at 6:15
7
Solved
I'm going through the JPA starter tutorial for spring boot am struggling.
I know the question has been asked sometimes here ('Field required a bean of type that could not be found.' error s...
Succoth asked 4/9, 2018 at 10:51
3
Solved
Already read lots of questions about the same issue, but I still not be able to solve this problem.
I need to have a String primary key on my database.
import javax.persistence.Entity;
import jav...
Reticulum asked 24/8, 2018 at 19:40
1
Solved
I upgraded from Spring Boot (Data) 3.1.5 to 3.2.0.
Several of my queries in the Repositories throw exceptions now on application start in the validation phase:
Caused by: Cannot compare left expres...
Mccraw asked 24/11, 2023 at 6:58
7
Solved
I'm writing a code-gen tool to generate backend wiring code for Spring Boot applications using Spring Data JPA and it's mildly annoying me that the methods in the CrudRepository return Iterable rat...
Donative asked 10/1, 2016 at 5:1
6
Solved
I am using Spring Boot 1.4.1 which uses Hibernate 5.0.11. Initially I configured a data source using application.properties like this:
spring.datasource.uncle.url=jdbc:jtds:sqlserver://hostname:por...
Displant asked 9/11, 2016 at 14:30
17
Solved
Well the question pretty much says everything. Using JPARepository how do I update an entity?
JPARepository has only a save method, which does not tell me if it's create or update actually. For ex...
Leucotomy asked 9/8, 2012 at 10:33
7
Solved
Is there a way to retrieve the last X number of results from a query?
For example - If want the first ten results, I see that example here works: setMaxResults for Spring-Data-JPA annotation?
p...
Anaphase asked 5/6, 2014 at 19:41
3
Solved
I'm using Spring Boot (1.4.4.REALEASE) with Spring Data in order to manage a MySql Database. I've got the following case:
We update one revision performed in one equipment using the RevisionServi...
Population asked 17/2, 2017 at 9:42
5
Solved
I have two entity manager configurations for two separate databases but when I try to auto-wire an entity manager in to configure my GraphQLExecutor bean I get an exception stating that there are t...
Pericranium asked 7/7, 2017 at 11:53
6
Solved
I downloaded the simple JPA Spring Boot tutorial and it worked just fine. However, when I attempt to replicate this simple behavior in my own test project, I get a "could not autowire" error on the...
Midpoint asked 9/10, 2016 at 4:2
11
I'm not able to use Spring Data JPA projections and specifications together. I have the following setup:
Entity:
@Entity
public class Country {
@Id
@GeneratedValue(strategy = GenerationType.AU...
Debi asked 17/1, 2017 at 8:37
4
I read https://vladmihalcea.com/the-best-way-to-map-a-onetoone-relationship-with-jpa-and-hibernate/.
I tried suggestion config like(using spring data JPA,hibernate 5.0 as vendor ):
public class Pa...
Antrim asked 6/12, 2017 at 8:55
20
Solved
I am using Spring JPA to perform all database operations. However I don't know how to select specific columns from a table in Spring JPA?
For example:
SELECT projectId, projectName FROM projects
Guv asked 25/2, 2014 at 7:25
6
Solved
I have a model that has a pretty large graph of sub entities and hibernate ends up making around 9 statements to lazily fetch all of the data needed but about 4 levels deep I get a "could not initi...
Dayfly asked 12/4, 2016 at 20:13
4
After starting my SpringBoot application, getting an exception on few minutes of the server startup. Did not use any HikariPool Configuration externally, Spring Boot is using HikariPool by default
...
Blockish asked 19/2, 2020 at 23:33
5
I am trying to migrate the application. I am working on from Hibernate to Spring Data JPA.
Though Spring Data JPA offers simple methods for query building, I am stuck up in creating query method th...
Mullens asked 4/3, 2016 at 5:46
0
In my Spring Boot 3 project with hibernate 6 I am trying to check the a name is not in use before updating (and saving) a entity.
I want to leave the method annotated with @Transactional and I want...
Usage asked 9/10, 2023 at 7:37
2
Solved
in Spring Data JPA Repository i need to specify multiple methods that do the same thing (eg. findAll) but specifying different @EntityGraph annotation (the goal is to have optimized methods to use ...
Amie asked 3/5, 2020 at 23:29
© 2022 - 2024 — McMap. All rights reserved.