Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [spring-data-jpa]

Spring Data - JPA is part of the Spring Data umbrella project which makes it easy to implement JPA based repositories

0 votes
1 answer
11 views

JPA EntityExistsException thown when saving and object

I have the following 2 objects in my project that share the common Composite Primary Key as and ID: @Entity @Immutable @Cacheable(true) @Cache(usage = CacheConcurrencyStrategy.READ_ONLY) @Table(name = ...
Martin819's user avatar
  • 490
0 votes
0 answers
8 views

Is it good to have reference to JPARepositry when implementing Custom Repository?

Is it good to have reference to JPARepositry when implementing Custom Repository? For example, imagine that I have repository for my entity: @Repository public interface EntityRepository extends ...
azizairo's user avatar
0 votes
0 answers
15 views

EntityManager select only OneToMany field give exception

I am using EntityManager in Spring data JPA with Hibernate as provider. I have 2 entities Post entity @Entity @AllArgsConstructor @NoArgsConstructor @Getter @Setter @Table @NamedEntityGraph(name = &...
titanium's user avatar
-1 votes
0 answers
10 views

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid column name 'dept_name'

I am building Microservice project where I am using Spring Boot application , DB is MS SQL 2022, I am using ready DB table which create some application, I want get data from DB table in my table I ...
Ruslan Şirbidov's user avatar
0 votes
1 answer
19 views

Spring Boot Application Runs in IntelliJ IDEA but Fails with mvn install Due to JDBC URL Error

I'm encountering an issue with my Spring Boot application. It runs perfectly fine when I start it directly from IntelliJ IDEA by clicking the play button. However, when I try to build the project ...
Ramiro Schettino's user avatar
-1 votes
0 answers
15 views

Problem when dealing with translated tables via JPA

I have have a question about how should we work with db in JPA manner when dealing with translated tables. So, let's assume that I have next entities: class A { @Id @Column(name = "id&...
azizairo's user avatar
0 votes
0 answers
21 views

Fetch both sides without cyclic infinite loop

public class Famille { @Id @GeneratedValue(strategy = GenerationType.UUID) private UUID id; @Column(length = 30, nullable = false) private String nom; @Column(length = 12, ...
amin hlel's user avatar
-2 votes
1 answer
30 views

JPA get highest value in column with where condition

I'm using a JpaRepository to access a table in my database. I defined the table through an entity. My goal is, to get the highest value in the wordNumber column. But I also have to distinguish entries ...
Fi0x's user avatar
  • 144
0 votes
0 answers
30 views

Proper way to implement @TenantId in hibernate 6 for column discriminator multitenancy

I am trying to implement column discriminator for shared database shared schema multi tenancy in spring boot hibernate 6. I read the migration guide which says I should use @TenantId on the column, ...
John Elesho's user avatar
0 votes
2 answers
29 views

How to cache the view result of a Spring JPA query

Given the following entity... @Entity @Getter @Setter public class OrderDTD { private Long id; ... private String orderType; private String orderStatus; ... and the ...
j3d's user avatar
  • 9,660
0 votes
0 answers
19 views

Spring JPA - using extra table in @ManyToMany relationship

I have a database structure like this: entity tables: CREATE TABLE IF NOT EXISTS city ( city_id VARCHAR(255) PRIMARY KEY, name VARCHAR(255) NOT NULL ); CREATE TABLE IF NOT EXISTS store ( ...
Valdemar's user avatar
0 votes
1 answer
35 views

Bind column name into a prepared statement

I have this interface CustomFooRepository { fun findByValueIgnoreCase(query: String, type: RequestType): List<Foo> } class CustomFooRepositoryImpl( @PersistenceContext private val ...
four-eyes's user avatar
  • 12k
0 votes
0 answers
11 views

JPA: How to join OR get fields from custom function in JPQL

So, i have some configuration public class MyPostgreSQL9Dialect extends PostgreSQL94Dialect { public MyPostgreSQL9Dialect() { super(); registerFunction("cust_func", new ...
Michael's user avatar
-1 votes
1 answer
49 views

Use dynamic column names in Spring Data JPA

I am trying to use dynamic column names and values in a query in Spring Data JPA interface CustomFooRepository { fun findByValueIgnoreCase(query: String, type: RequestType): List<Foo> } ...
four-eyes's user avatar
  • 12k
-1 votes
2 answers
38 views

any scenario's to use @Transactional annotation at Repository delete method?

I am reveiewing the code for one of the senior member for the first peer review so he added @Transactional annotation at custom repository with delete method. The custom Repository delete method is ...
Anil Nivargi's user avatar
  • 1,663

15 30 50 per page
1
2 3 4 5
1550