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

All Questions

Tagged with
0 votes
0 answers
3 views

release conenction in JPA multitenancy connection provider

How to handle exception in releaseConenction(String tenantIdentifier, Connection connetcion) method which implements MultiTenantConnectionProvider. How do we ensure the connetcion will be closed if ...
aryaD's user avatar
  • 3
0 votes
0 answers
8 views

Nested Interface Projections in Spring Data JPA

I am working on a spring boot based application where I want to utilize interface based projection as I want to select partial column from my mysql database. I have a CourseEntity.java class with a ...
Usama Abubakar's user avatar
0 votes
1 answer
24 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
-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
-1 votes
2 answers
39 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
0 votes
0 answers
31 views

Issuse with relationship mapping MapKeyEnumerated with an Entity List as values

I have this Entity @Entity public class MealPlanADay { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @JsonIgnore private Long id; //@OneToMany(cascade = CascadeType.ALL,...
Omar122's user avatar
0 votes
0 answers
24 views

Hibernate seems to ignore the dialect I specify

I'm using Olingo JPA for producing an OData API. The database I'm connecting to doesn't support the 'LOCATE' function; instead it implements 'POSITION'. This seems to be true of a few databases: ...
Person's user avatar
  • 1
0 votes
0 answers
28 views

How to Convert a Complex SQL Query to Hibernate Criteria API

I'm learning about Hibernate's Criteria API and would like to know how to convert this particular SQL query to Criteria API. Here is the SQL query I’m working with: select s1.score as score,count(s1....
random guy's user avatar
0 votes
0 answers
21 views

Impossible to use DATEDIFF in java JPA criteria queries?

For the life of me, I cannot figure this out. I want to select entities from my H2 database, and get the difference between an entities timestamp column and a passed parameter. trying var dateDiff = ...
diet coke's user avatar
0 votes
0 answers
15 views

Handling Date comparisons in MYSQL 8 and Spring boot without Milliseconds

We are upgrading our project from Mysql 5 to Mysql 8. there is weird issue coming in db queries in date handling. On MySQL 5, while saving data to db, the date used to be saved with 'yyyy-MM-dd HH:mm:...
amangautam1's user avatar
1 vote
1 answer
50 views

Issue with @ManyToOne Lazy Loading: Unable to Find Entity by ID

Edit I added an attribute that can be the problem, it had the same column name in the yEntity and the xEntity, but he is not part of the relationship (the Integer yEntity in yEntity who is a reference ...
maxime Lassort's user avatar
0 votes
1 answer
23 views

Why Join attribute appending with join column?

I have two entity @Entity @Table(name = "Student") class Student{ @Id @Column(name = "Id") private Integer id; @Column(name = "name") private String name; @OneToMany(...
TeamZ's user avatar
  • 361
0 votes
1 answer
42 views

Joining Entities by a Range - Hibernate

I have a question regarding Hibernate that's been bothering me for some time. Consider I have two entities: @Entity public class Statement { @Id @Column private int id; @Column ...
Krusty the Clown's user avatar
0 votes
1 answer
60 views

JPA entity ID field with a SQL Server 2022 Sequence

I am trying to connect my Spring Boot service to a SQL Server 2022 database, but I am having issues with a sequence: public class SomeEntity { @Id @SequenceGenerator(name = "some_seq"...
kayelbb's user avatar
  • 55
-2 votes
2 answers
61 views

Java Spring Boot JPA database connection issue

Im working on Java Spring Boot application, and have a problem with connection to database via JPA. JPA cannot connect to my db. I tried many url configurations, but connection failed and such ...
koszatree's user avatar

15 30 50 per page
1
2 3 4 5
403